[FFmpeg-cvslog] avformat/utils: Do not overwrite, but use sample_fmt from context

Michael Niedermayer git at videolan.org
Thu Jun 9 19:42:08 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun  9 11:22:01 2016 +0200| [6826f16e4a3629c801396dca3ada8a78fc506e85] | committer: Michael Niedermayer

avformat/utils: Do not overwrite, but use sample_fmt from context

Fixes Ticket 3759

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6826f16e4a3629c801396dca3ada8a78fc506e85
---

 libavformat/utils.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index ff52b52..cb8d910 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3753,6 +3753,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
         /* if no packet was ever seen, update context now for has_codec_parameters */
         if (!st->internal->avctx_inited) {
+            if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
+                st->codecpar->format == AV_SAMPLE_FMT_NONE)
+                st->codecpar->format = st->internal->avctx->sample_fmt;
             ret = avcodec_parameters_to_context(st->internal->avctx, st->codecpar);
             if (ret < 0)
                 goto find_stream_info_err;



More information about the ffmpeg-cvslog mailing list