Module: libav
Branch: master
Commit: df8d5eaa14ab584695d190b15aeec210b60913c5

Author:    Alex Converse <[email protected]>
Committer: Alex Converse <[email protected]>
Date:      Tue Apr 17 11:32:56 2012 -0700

avcodec_string: Favor AVCodecContext.codec over the default codec.

This improves output for formats with more than one AVCodec.

---

 libavcodec/utils.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 58b7865..7caf93f 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);

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to