From df8d5eaa14ab584695d190b15aeec210b60913c5 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Tue, 17 Apr 2012 11:32:56 -0700 Subject: [PATCH] avcodec_string: Favor AVCodecContext.codec over the default codec. This improves output for formats with more than one AVCodec. --- libavcodec/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 58b7865fa4..7caf93f65d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1498,7 +1498,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) int bitrate; AVRational display_aspect_ratio; - if (encode) + if (enc->codec) + p = enc->codec; + else if (encode) p = avcodec_find_encoder(enc->codec_id); else p = avcodec_find_decoder(enc->codec_id);