diff mbox series

[FFmpeg-devel,10/17] fftools/ffmpeg: copy average framerate for streamcopy, when known

Message ID 20210405110952.17679-11-anton@khirnov.net
State Accepted
Commit f6ea2ee005740247a446d28174943b3606721967
Headers show
Series [FFmpeg-devel,01/17] lavu: postpone child_class_next API removal
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

Anton Khirnov April 5, 2021, 11:09 a.m. UTC
---
 fftools/ffmpeg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8e6206647f..3ad11452da 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3144,7 +3144,11 @@  static int init_output_stream_streamcopy(OutputStream *ost)
 
     if (!ost->frame_rate.num)
         ost->frame_rate = ist->framerate;
-    ost->st->avg_frame_rate = ost->frame_rate;
+
+    if (ost->frame_rate.num)
+        ost->st->avg_frame_rate = ost->frame_rate;
+    else
+        ost->st->avg_frame_rate = ist->st->avg_frame_rate;
 
     ret = avformat_transfer_internal_stream_timing_info(of->ctx->oformat, ost->st, ist->st, copy_tb);
     if (ret < 0)