]> git.sesse.net Git - ffmpeg/commitdiff
avformat/webm_chunk: Use ff_stream_encode_params_copy()
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Tue, 13 Apr 2021 16:27:10 +0000 (18:27 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sun, 18 Apr 2021 00:29:23 +0000 (02:29 +0200)
It is simpler and more complete (e.g. it copies the framerate
information which allows to write the default duration element).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavformat/webm_chunk.c

index f1bee5fa9ff424b80a53d8415195b714715428b2..fb5b20a8cce780fad7758ac40a029b486bcc9ca6 100644 (file)
@@ -93,15 +93,9 @@ static int webm_chunk_init(AVFormatContext *s)
     if (!(st = avformat_new_stream(oc, NULL)))
         return AVERROR(ENOMEM);
 
-    if ((ret = avcodec_parameters_copy(st->codecpar, ost->codecpar)) < 0 ||
-        (ret = av_dict_copy(&st->metadata, ost->metadata, 0))        < 0)
+    if ((ret = ff_stream_encode_params_copy(st, ost)) < 0)
         return ret;
 
-    st->sample_aspect_ratio = ost->sample_aspect_ratio;
-    st->disposition         = ost->disposition;
-    avpriv_set_pts_info(st, ost->pts_wrap_bits, ost->time_base.num,
-                                                ost->time_base.den);
-
     if (wc->http_method)
         if ((ret = av_dict_set(&dict, "method", wc->http_method, 0)) < 0)
             return ret;