]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/assdec.c
avcodec/avcodec: Store whether AVCodec->close needs to be called
[ffmpeg] / libavformat / assdec.c
index d89c14e5b8e353c70a0406ec2625e3b22a5891ce..4a9650fe764523713169b024dc11258bc0b35633 100644 (file)
@@ -33,7 +33,7 @@ typedef struct ASSContext {
     unsigned readorder;
 } ASSContext;
 
-static int ass_probe(AVProbeData *p)
+static int ass_probe(const AVProbeData *p)
 {
     char buf[13];
     FFTextReader tr;
@@ -160,6 +160,8 @@ static int ass_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &ass->q);
 
 end:
+    if (res < 0)
+        ass_read_close(s);
     av_bprint_finalize(&header, NULL);
     av_bprint_finalize(&line,   NULL);
     av_bprint_finalize(&rline,  NULL);
@@ -180,7 +182,7 @@ static int ass_read_seek(AVFormatContext *s, int stream_index,
                                    min_ts, ts, max_ts, flags);
 }
 
-AVInputFormat ff_ass_demuxer = {
+const AVInputFormat ff_ass_demuxer = {
     .name           = "ass",
     .long_name      = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
     .priv_data_size = sizeof(ASSContext),