On Tue, Jan 13, 2015 at 3:07 PM, Anton Khirnov <[email protected]> wrote: > Quoting Vittorio Giovara (2014-12-04 20:56:27) >> --- >> libavformat/avformat.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/libavformat/avformat.h b/libavformat/avformat.h >> index 197a3f1..f4e1fec 100644 >> --- a/libavformat/avformat.h >> +++ b/libavformat/avformat.h >> @@ -1381,6 +1381,8 @@ const AVClass *avformat_get_class(void); >> * @param c If non-NULL, the AVCodecContext corresponding to the new stream >> * will be initialized to use this codec. This is needed for e.g. >> codec-specific >> * defaults to be set, so codec should be provided if it is known. >> + * @note @ref avcodec_open2() will be called internally for the new stream >> + * AVCodecContext. >> * > > I don't really see why should this be mentioned in the documentation. > > First, it's an internal imlementation detail, which might change in the > future. > Second, it's not even always true, since codec will not be opened if all > the information is provided by the demuxer. > Finally, I don't see why would such an information be useful to the > caller.
Because if you try to avcodec_open2() on the stream codec the application is likely to crash (at least it crashed in my case). In my opinion the caller should be informed that the codec "will not be opened if all the information is provided by the demuxer" and only in that case he or she should call avcodec_open2(). -- Vittorio _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
