aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/segment.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2017-01-13 12:04:16 +0100
committerAnton Khirnov <anton@khirnov.net>2017-02-11 11:37:45 +0100
commit6f554521afdf7ab4edbfaa9536660a1dca946b19 (patch)
tree0a75f66dd0a227def77b5bf490b303182269e0a6 /libavformat/segment.c
parent99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d (diff)
downloadffmpeg-6f554521afdf7ab4edbfaa9536660a1dca946b19.tar.gz
Use the new AVIOContext destructor.
Diffstat (limited to 'libavformat/segment.c')
-rw-r--r--libavformat/segment.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index fd68a9f753..7d23afc013 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -184,10 +184,10 @@ static int open_null_ctx(AVIOContext **ctx)
return 0;
}
-static void close_null_ctx(AVIOContext *pb)
+static void close_null_ctx(AVIOContext **pb)
{
- av_free(pb->buffer);
- av_free(pb);
+ av_free((*pb)->buffer);
+ avio_context_free(pb);
}
static void seg_free_context(SegmentContext *seg)
@@ -259,7 +259,7 @@ static int seg_write_header(AVFormatContext *s)
}
if (!seg->write_header_trailer) {
- close_null_ctx(oc->pb);
+ close_null_ctx(&oc->pb);
if ((ret = s->io_open(s, &oc->pb, oc->filename, AVIO_FLAG_WRITE, NULL)) < 0)
goto fail;
}
@@ -353,7 +353,7 @@ static int seg_write_trailer(struct AVFormatContext *s)
if ((ret = open_null_ctx(&oc->pb)) < 0)
goto fail;
ret = av_write_trailer(oc);
- close_null_ctx(oc->pb);
+ close_null_ctx(&oc->pb);
} else {
ret = segment_end(oc, 1);
}