diff options
author | wm4 <wm4@nowhere> | 2013-04-30 00:52:32 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-30 00:52:32 +0200 |
commit | ea7b920184a865a3343001318fc4a32dcfc7b4f5 (patch) | |
tree | fbefd8539b77ee7473ad73740cc8ffa97bc4ffbe /sub/subreader.c | |
parent | 3dcc83a70609d392c8ecd917dd5c16995424e9c4 (diff) | |
parent | d98e61ea438db66323734ad1b6bea66411a3c97b (diff) | |
download | mpv-ea7b920184a865a3343001318fc4a32dcfc7b4f5.tar.bz2 mpv-ea7b920184a865a3343001318fc4a32dcfc7b4f5.tar.xz |
Merge branch 'master' into low_quality_intel_crap
Conflicts:
video/out/gl_video_shaders.glsl
video/out/vo_opengl.c
Diffstat (limited to 'sub/subreader.c')
-rw-r--r-- | sub/subreader.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sub/subreader.c b/sub/subreader.c index bdcc79a64a..0f1b6c9bbd 100644 --- a/sub/subreader.c +++ b/sub/subreader.c @@ -386,14 +386,14 @@ static subtitle *sub_ass_read_line_subviewer(stream_t *st, subtitle *current, int a1, a2, a3, a4, b1, b2, b3, b4, j = 0; while (!current->text[0]) { - char line[LINE_LEN + 1], full_line[LINE_LEN + 1], sep; + char line[LINE_LEN + 1], full_line[LINE_LEN + 1]; int i; /* Parse SubRip header */ if (!stream_read_line(st, line, LINE_LEN, utf16)) return NULL; - if (sscanf(line, "%d:%d:%d%[,.:]%d --> %d:%d:%d%[,.:]%d", - &a1, &a2, &a3, &sep, &a4, &b1, &b2, &b3, &sep, &b4) < 10) + if (sscanf(line, "%d:%d:%d%*1[,.:]%d --> %d:%d:%d%*1[,.:]%d", + &a1, &a2, &a3, &a4, &b1, &b2, &b3, &b4) < 8) continue; current->start = a1 * 360000 + a2 * 6000 + a3 * 100 + a4 / 10; @@ -450,7 +450,7 @@ static subtitle *sub_read_line_subviewer(stream_t *st,subtitle *current, return sub_ass_read_line_subviewer(st, current, args); while (!current->text[0]) { if (!stream_read_line (st, line, LINE_LEN, utf16)) return NULL; - if ((len=sscanf (line, "%d:%d:%d%[,.:]%d --> %d:%d:%d%[,.:]%d",&a1,&a2,&a3,(char *)&i,&a4,&b1,&b2,&b3,(char *)&i,&b4)) < 10) + if ((len=sscanf (line, "%d:%d:%d%*1[,.:]%d --> %d:%d:%d%*1[,.:]%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8) continue; current->start = a1*360000+a2*6000+a3*100+a4/10; current->end = b1*360000+b2*6000+b3*100+b4/10; @@ -1324,8 +1324,8 @@ sub_data* sub_read_file(char *filename, float fps, struct MPOpts *opts) static const struct subreader sr[]= { { sub_read_line_microdvd, NULL, "microdvd" }, - { sub_read_line_subrip, NULL, "subrip" }, - { sub_read_line_subviewer, NULL, "subviewer" }, + { sub_read_line_subrip, NULL, "subviewer" }, + { sub_read_line_subviewer, NULL, "subrip" }, { sub_read_line_sami, NULL, "sami" }, { sub_read_line_vplayer, NULL, "vplayer" }, { sub_read_line_rt, NULL, "rt" }, @@ -1684,6 +1684,7 @@ if ((suboverlap_enabled == 2) || if (return_sub == NULL) return NULL; subt_data = talloc_zero(NULL, sub_data); talloc_set_destructor(subt_data, sub_destroy); + subt_data->codec = srp->name; subt_data->filename = strdup(filename); subt_data->sub_uses_time = uses_time; subt_data->sub_num = sub_num; |