[vlc-commits] subtitle: fix AQT subtitle parsing

Steve Lhomme git at videolan.org
Tue Jan 19 07:38:11 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 18 15:36:53 2021 +0100| [874f6d8115ed68bac202f66e84b5e0e7da544b6d] | committer: Steve Lhomme

subtitle: fix AQT subtitle parsing

The numbers we read are frame numbers. There's a start and a stop frame number,
not just the start frame. The stop frame number was discarded so far as the
next start frame.
(based on http://web.archive.org/web/20070210095721/http://www.volny.cz/aberka/czech/aqt.html
and libavformat)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=874f6d8115ed68bac202f66e84b5e0e7da544b6d
---

 modules/demux/subtitle.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/demux/subtitle.c b/modules/demux/subtitle.c
index 968a356a59..f117bda2b7 100644
--- a/modules/demux/subtitle.c
+++ b/modules/demux/subtitle.c
@@ -1599,18 +1599,16 @@ static int ParseAQT(vlc_object_t *p_obj, subs_properties_t *p_props, text_t *txt
         /* Data Lines */
         if( sscanf (s, "-->> %d", &t) == 1)
         {
-            p_subtitle->i_start = (int64_t)t; /* * FPS*/
-            p_subtitle->i_stop  = -1;
-
             /* Starting of a subtitle */
             if( i_firstline )
             {
+                p_subtitle->i_start = t * p_props->i_microsecperframe;
                 i_firstline = 0;
             }
             /* We have been too far: end of the subtitle, begin of next */
             else
             {
-                TextPreviousLine( txt );
+                p_subtitle->i_stop  = t * p_props->i_microsecperframe;
                 break;
             }
         }



More information about the vlc-commits mailing list