Commit c637ea54 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Small fix for PJS to remove "".

parent 971d6b76
...@@ -56,12 +56,13 @@ static void Close( vlc_object_t *p_this ); ...@@ -56,12 +56,13 @@ static void Close( vlc_object_t *p_this );
#define SUB_TYPE_LONGTEXT \ #define SUB_TYPE_LONGTEXT \
N_("Force the subtiles format. Valid values are : \"microdvd\", " \ N_("Force the subtiles format. Valid values are : \"microdvd\", " \
"\"subrip\", \"ssa1\", \"ssa2-4\", \"ass\", \"vplayer\" " \ "\"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).") "should always work).")
static const char *ppsz_sub_type[] = static const char *ppsz_sub_type[] =
{ {
"auto", "microdvd", "subrip", "subviewer", "ssa1", "auto", "microdvd", "subrip", "subviewer", "ssa1",
"ssa2-4", "ass", "vplayer", "sami", "dvdsubtitle", "mpl2" "ssa2-4", "ass", "vplayer", "sami", "dvdsubtitle", "mpl2",
"aqt", "pjs"
}; };
vlc_module_begin(); vlc_module_begin();
...@@ -1309,17 +1310,20 @@ static int ParsePJS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx ) ...@@ -1309,17 +1310,20 @@ static int ParsePJS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
psz_text = malloc( strlen(s) + 1 ); psz_text = malloc( strlen(s) + 1 );
/* Data Lines */ /* 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 */ /* 1/10th of second ? Frame based ? FIXME */
p_subtitle->i_start = 10 * t1; p_subtitle->i_start = 10 * t1;
p_subtitle->i_stop = 10 * t2; p_subtitle->i_stop = 10 * t2;
/* Remove latest " */
psz_text[ strlen(psz_text) - 1 ] = '\0 ';
break; break;
} }
free( psz_text ); free( psz_text );
} }
p_subtitle->psz_text = psz_text; p_subtitle->psz_text = psz_text;
msg_Dbg( p_demux, "%s", psz_text );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment