aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_ass.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-02-13 10:26:42 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-02-14 16:33:53 +0100
commitbb3303b94c1c3f29116d096f5a51c23dbb8f577a (patch)
tree8b8e5463c705656e4d89966d999ee45290b9bee1 /libavfilter/vf_ass.c
parent7d0e3b197c817b307d599a23704a44763ed0bbdd (diff)
downloadffmpeg-bb3303b94c1c3f29116d096f5a51c23dbb8f577a.tar.gz
lavfi/vf_ass: ignore subtitles decoding errors.
A broken packet with invalid data in the middle of the stream should not prevent from decoding the rest of the file. Work around trac ticket #2264.
Diffstat (limited to 'libavfilter/vf_ass.c')
-rw-r--r--libavfilter/vf_ass.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/vf_ass.c b/libavfilter/vf_ass.c
index ade1b37374..85dd5ce1ee 100644
--- a/libavfilter/vf_ass.c
+++ b/libavfilter/vf_ass.c
@@ -318,14 +318,18 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
if (pkt.stream_index == sid) {
ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt);
- if (ret < 0 || !got_subtitle)
- break;
+ if (ret < 0) {
+ av_log(ctx, AV_LOG_WARNING, "Error decoding: %s (ignored)\n",
+ av_err2str(ret));
+ } else if (got_subtitle) {
+ /* TODO reindent */
for (i = 0; i < sub.num_rects; i++) {
char *ass_line = sub.rects[i]->ass;
if (!ass_line)
break;
ass_process_data(ass->track, ass_line, strlen(ass_line));
}
+ }
}
av_free_packet(&pkt);
avsubtitle_free(&sub);