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

oggk at svn.xiph.org oggk at svn.xiph.org
Mon Feb 1 08:14:41 PST 2010


Author: oggk
Date: 2010-02-01 08:14:41 -0800 (Mon, 01 Feb 2010)
New Revision: 16863

Modified:
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
when subtitles input comes from a srt file, always setup millisecond
 timing resolution, as that's what SRT timings may have.



Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-02-01 06:30:42 UTC (rev 16862)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2010-02-01 16:14:41 UTC (rev 16863)
@@ -1208,19 +1208,19 @@
                 }
                 kate_info_set_language(ki, ks->subtitles_language);
                 kate_info_set_category(ki, ks->subtitles_category[0]?ks->subtitles_category:"SUB");
-                if (this->force_input_fps.num > 0) {
-                    ki->gps_numerator = this->force_input_fps.num;    /* fps= numerator/denominator */
-                    ki->gps_denominator = this->force_input_fps.den;
-                }
-                else {
-                    if (this->framerate_new.num > 0) {
-                        // new framerate is interger only right now,
-                        // so denominator is always 1
-                        ki->gps_numerator = this->framerate_new.num;
-                        ki->gps_denominator = this->framerate_new.den;
+                if (ks->stream_index >= 0) {
+                    if (this->force_input_fps.num > 0) {
+                        ki->gps_numerator = this->force_input_fps.num;    /* fps= numerator/denominator */
+                        ki->gps_denominator = this->force_input_fps.den;
                     }
                     else {
-                        if (ks->stream_index >= 0) {
+                        if (this->framerate_new.num > 0) {
+                            // new framerate is interger only right now,
+                            // so denominator is always 1
+                            ki->gps_numerator = this->framerate_new.num;
+                            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;
@@ -1231,12 +1231,13 @@
                                 ki->gps_denominator = vstream_fps.den;
                             }
                         }
-                        else {
-                            ki->gps_numerator = vstream_fps.num;
-                            ki->gps_denominator = vstream_fps.den;
-                        }
                     }
                 }
+                else {
+                    // SRT files have millisecond timing
+                    ki->gps_numerator = 1000;
+                    ki->gps_denominator = 1;
+                }
                 ki->granule_shift = 32;
             }
           }



More information about the commits mailing list