[FFmpeg-cvslog] avcodec: Make sure codec_type is set by avcodec_get_context_defaults2
Martin Storsjö
git at videolan.org
Fri Nov 4 01:55:58 CET 2011
ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Nov 3 11:40:13 2011 +0200| [cae4f4b77e7dc037ad5dfcc7bc636788f1420ba9] | committer: Martin Storsjö
avcodec: Make sure codec_type is set by avcodec_get_context_defaults2
This function used to set codec_type. With the current fallback
implementation based on avcodec_get_context_defaults3, codec_type
won't be set to the value passed in, but will be set to
AVMEDIA_TYPE_UNKNOWN. Legacy callers of this function might expect
this field to be set to the value passed in.
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cae4f4b77e7dc037ad5dfcc7bc636788f1420ba9
---
libavcodec/options.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libavcodec/options.c b/libavcodec/options.c
index fdc8a71..a08ed98 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -539,6 +539,7 @@ static const AVClass av_codec_context_class = {
#if FF_API_ALLOC_CONTEXT
void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
avcodec_get_context_defaults3(s, NULL);
+ s->codec_type = codec_type;
}
#endif
More information about the ffmpeg-cvslog
mailing list