From d29de719a090effe244bdeedc72e34b80ac46618 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni@gmx.at>
Date: Tue, 31 Oct 2006 00:39:02 +0000
Subject: [PATCH] better timebase selection heuristic for video stream copy
 fixes -ss -t -vcodec copy

Originally committed as revision 6847 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 ffmpeg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 89bba27e040..ff92ebf52bc 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1535,7 +1535,10 @@ static int av_encode(AVFormatContext **output_files,
             codec->bit_rate = icodec->bit_rate;
             codec->extradata= icodec->extradata;
             codec->extradata_size= icodec->extradata_size;
-            codec->time_base = icodec->time_base;
+            if(av_q2d(icodec->time_base) > av_q2d(ist->st->time_base))
+                codec->time_base = icodec->time_base;
+            else
+                codec->time_base = ist->st->time_base;
             switch(codec->codec_type) {
             case CODEC_TYPE_AUDIO:
                 codec->sample_rate = icodec->sample_rate;
-- 
GitLab