[xiph-commits] r16818 - trunk/ffmpeg2theora/src

oggk at svn.xiph.org oggk at svn.xiph.org
Tue Jan 26 02:56:58 PST 2010


Author: oggk
Date: 2010-01-26 02:56:58 -0800 (Tue, 26 Jan 2010)
New Revision: 16818

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
only use ffmpeg's per-stream frame rate if the subtitles come from ffmpeg itself



Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-01-26 09:38:18 UTC (rev 16817)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-01-26 10:56:58 UTC (rev 16818)
@@ -1217,10 +1217,16 @@
                         ki->gps_denominator = this->framerate_new.den;
                     }
                     else {
-                        AVStream *stream = this->context->streams[ks->stream_index];
-                        if (stream->time_base.num > 0) {
-                            ki->gps_numerator = stream->time_base.den;
-                            ki->gps_denominator = stream->time_base.num;
+                        if (ks->stream_index >= 0) {
+                            AVStream *stream = this->context->streams[ks->stream_index];
+                            if (stream->time_base.num > 0) {
+                                ki->gps_numerator = stream->time_base.den;
+                                ki->gps_denominator = stream->time_base.num;
+                            }
+                            else {
+                                ki->gps_numerator = vstream_fps.num;
+                                ki->gps_denominator = vstream_fps.den;
+                            }
                         }
                         else {
                             ki->gps_numerator = vstream_fps.num;



More information about the commits mailing list