]> git.sesse.net Git - vlc/commitdiff
Small fix for PJS to remove "".
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 2 May 2008 07:45:43 +0000 (00:45 -0700)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 2 May 2008 07:45:43 +0000 (00:45 -0700)
modules/demux/subtitle.c

index 038006d9c1a8aac99e4a9c26f4ada4930886e054..d453f5672c1f665ac1980a9ae8d73f9c5adc6522 100644 (file)
@@ -56,12 +56,13 @@ static void Close( vlc_object_t *p_this );
 #define SUB_TYPE_LONGTEXT \
     N_("Force the subtiles format. Valid values are : \"microdvd\", " \
     "\"subrip\",  \"ssa1\", \"ssa2-4\", \"ass\", \"vplayer\" " \
-    "\"sami\", \"dvdsubtitle\", \"mpl2\" and \"auto\" (meaning autodetection, this " \
+    "\"sami\", \"dvdsubtitle\", \"mpl2\", \"aqt\", \"pjs\" and \"auto\" (meaning autodetection, this " \
     "should always work).")
 static const char *ppsz_sub_type[] =
 {
     "auto", "microdvd", "subrip", "subviewer", "ssa1",
-    "ssa2-4", "ass", "vplayer", "sami", "dvdsubtitle", "mpl2"
+    "ssa2-4", "ass", "vplayer", "sami", "dvdsubtitle", "mpl2",
+    "aqt", "pjs"
 };
 
 vlc_module_begin();
@@ -1309,17 +1310,20 @@ static int ParsePJS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
         psz_text = malloc( strlen(s) + 1 );
 
         /* Data Lines */
-        if( sscanf (s, "%d,%d,%[^\n\r]", &t1, &t2, psz_text ) == 3 )
+        if( sscanf (s, "%d,%d,\"%[^\n\r]", &t1, &t2, psz_text ) == 3 )
         {
             /* 1/10th of second ? Frame based ? FIXME */
             p_subtitle->i_start = 10 * t1;
             p_subtitle->i_stop = 10 * t2;
+            /* Remove latest " */
+            psz_text[ strlen(psz_text) - 1 ] = '\0 ';
 
             break;
         }
         free( psz_text );
     }
     p_subtitle->psz_text = psz_text;
+    msg_Dbg( p_demux, "%s", psz_text );
     return VLC_SUCCESS;
 }