[FFmpeg-devel] [PATCH 4/8] lavf/segment: add deinit function
Rodger Combs
rodger.combs at gmail.com
Fri Apr 8 02:38:05 CEST 2016
---
libavformat/segment.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 9527c87..2dfd232 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -626,8 +626,9 @@ static int select_reference_stream(AVFormatContext *s)
return 0;
}
-static void seg_free_context(SegmentContext *seg)
+static void seg_free(AVFormatContext *s)
{
+ SegmentContext *seg = s->priv_data;
ff_format_io_close(seg->avf, &seg->list_pb);
avformat_free_context(seg->avf);
seg->avf = NULL;
@@ -907,9 +908,6 @@ fail:
seg->segment_frame_count++;
}
- if (ret < 0)
- seg_free_context(seg);
-
return ret;
}
@@ -1034,6 +1032,7 @@ AVOutputFormat ff_segment_muxer = {
.init = seg_init,
.write_packet = seg_write_packet,
.write_trailer = seg_write_trailer,
+ .deinit = seg_free,
.check_bitstream = seg_check_bitstream,
.priv_class = &seg_class,
};
@@ -1053,6 +1052,7 @@ AVOutputFormat ff_stream_segment_muxer = {
.init = seg_init,
.write_packet = seg_write_packet,
.write_trailer = seg_write_trailer,
+ .deinit = seg_free,
.check_bitstream = seg_check_bitstream,
.priv_class = &sseg_class,
};
--
2.7.3
More information about the ffmpeg-devel
mailing list