diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-01-14 02:24:13 +0400 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-07-01 20:35:06 +0400 |
commit | 3bee286ad280059e5aaf07d8f8a45f61964d5d79 (patch) | |
tree | b084477aa7d1bb3aa3bd2c5ce14592704e0ba470 /libavformat/segment.c | |
parent | 91ce7c21f042edda1add197d9456e69a11a19f05 (diff) |
lavf/segment: pass the top level chained muxer format context to segment_end()
Consistent with segment_start() and less confusing.
Diffstat (limited to 'libavformat/segment.c')
-rw-r--r-- | libavformat/segment.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index da2362602f..4480e4daf6 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -89,15 +89,17 @@ fail: return err; } -static int segment_end(AVFormatContext *oc) +static int segment_end(AVFormatContext *s) { + SegmentContext *seg = s->priv_data; + AVFormatContext *oc = seg->avf; int ret = 0; if (oc->oformat->write_trailer) ret = oc->oformat->write_trailer(oc); if (ret < 0) - av_log(oc, AV_LOG_ERROR, "Failure occurred when ending segment '%s'\n", + av_log(s, AV_LOG_ERROR, "Failure occurred when ending segment '%s'\n", oc->filename); avio_close(oc->pb); @@ -204,7 +206,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) av_log(s, AV_LOG_DEBUG, "Next segment starts at %d %"PRId64"\n", pkt->stream_index, pkt->pts); - ret = segment_end(oc); + ret = segment_end(s); if (!ret) ret = segment_start(s); @@ -242,7 +244,7 @@ static int seg_write_trailer(struct AVFormatContext *s) { SegmentContext *seg = s->priv_data; AVFormatContext *oc = seg->avf; - int ret = segment_end(oc); + int ret = segment_end(s); if (seg->list) avio_close(seg->pb); oc->streams = NULL; |