[FFmpeg-devel] [PATCH v4 2/2] avformat/imfdec: preserve stream information

pal at sandflow.com pal at sandflow.com
Sun Jul 31 23:37:58 EEST 2022


From: Pierre-Anthony Lemieux <pal at palemieux.com>

As discussed at https://trac.ffmpeg.org/ticket/9818, the IMF demuxer does not
currently preserve stream information such as language in the case of audio
streams.

---
 libavformat/imfdec.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index 71dfb26958..4cd6a56a09 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -579,12 +579,15 @@ static int set_context_streams_from_tracks(AVFormatContext *s)
             av_log(s, AV_LOG_ERROR, "Could not create stream\n");
             return AVERROR(ENOMEM);
         }
-        asset_stream->id = i;
-        ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar);
+
+        ret = ff_stream_params_copy(asset_stream, first_resource_stream);
         if (ret < 0) {
             av_log(s, AV_LOG_ERROR, "Could not copy stream parameters\n");
             return ret;
         }
+
+        asset_stream->id = i;
+        asset_stream->nb_frames = 0;
         avpriv_set_pts_info(asset_stream,
                             first_resource_stream->pts_wrap_bits,
                             first_resource_stream->time_base.num,
-- 
2.25.1



More information about the ffmpeg-devel mailing list