Browse code

ffmpeg: use framerate not fieldrate as filter input.

Fixes a problem described in Ticket1065

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/10/15 07:14:43
Showing 1 changed files
... ...
@@ -558,6 +558,13 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
558 558
     int pad_idx = in->pad_idx;
559 559
     int ret;
560 560
 
561
+    if (!ist->framerate.num) {
562
+        AVRational codec_fr = av_inv_q(ist->st->codec->time_base);
563
+        codec_fr.den *= ist->st->codec->ticks_per_frame;
564
+        if(av_q2d(codec_fr) < av_q2d(fr)*0.7)
565
+            fr = codec_fr;
566
+    }
567
+
561 568
     if (ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
562 569
         ret = sub2video_prepare(ist);
563 570
         if (ret < 0)