diff mbox series

[FFmpeg-devel,09/10] avformat/webm_chunk: Use ff_stream_encode_params_copy()

Message ID HE1PR0301MB21546E4A8C8C606BE08783008F4D9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 3651d6f276da32fcff8f7e6cb13513661e3c7bbc
Headers show
Series [FFmpeg-devel,01/10] fate/filter-video: Remove SAMPLES depedency from refcmp tests
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 15, 2021, 8:16 p.m. UTC
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 | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index f1bee5fa9f..fb5b20a8cc 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -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;