summaryrefslogtreecommitdiff
path: root/libavcodec/options.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-11-03 11:40:13 +0200
committerMartin Storsjö <martin@martin.st>2011-11-03 13:29:48 +0200
commitcae4f4b77e7dc037ad5dfcc7bc636788f1420ba9 (patch)
treeea4b9db9f6e050bf066a1ec300515d0c18a03a79 /libavcodec/options.c
parent1b6da627d49e98fe7661c9aa9ec4e16ab04dfda4 (diff)
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@martin.st>
Diffstat (limited to 'libavcodec/options.c')
-rw-r--r--libavcodec/options.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c
index fdc8a71337..a08ed98cce 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