diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-05 15:12:54 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-05 15:12:54 +0200 |
commit | 1bd22229d7bf582d2749d4f96e1e2fca7f1dc044 (patch) | |
tree | 5cb5cdb6a00296bbe871ecc4e2e073a368d167eb /libavformat | |
parent | d19728da6f0048d4f6208a34c849aee61c8e2b2a (diff) | |
parent | 73871dc96ff78053b9dcd0eb259b7f5a5308ec87 (diff) | |
download | ffmpeg-1bd22229d7bf582d2749d4f96e1e2fca7f1dc044.tar.gz |
Merge commit '73871dc96ff78053b9dcd0eb259b7f5a5308ec87'
* commit '73871dc96ff78053b9dcd0eb259b7f5a5308ec87':
segment: Use the public av_write_header/av_write_trailer functions
Conflicts:
libavformat/segment.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/segment.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index 9a4a1d52dc..11ece7c797 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -110,31 +110,10 @@ static int segment_start(AVFormatContext *s) &s->interrupt_callback, NULL)) < 0) return err; - if (!oc->priv_data && oc->oformat->priv_data_size > 0) { - oc->priv_data = av_mallocz(oc->oformat->priv_data_size); - if (!oc->priv_data) { - avio_close(oc->pb); - return AVERROR(ENOMEM); - } - if (oc->oformat->priv_class) { - *(const AVClass**)oc->priv_data = oc->oformat->priv_class; - av_opt_set_defaults(oc->priv_data); - } - } - - if ((err = oc->oformat->write_header(oc)) < 0) { - goto fail; - } + if ((err = avformat_write_header(oc, NULL)) < 0) + return err; return 0; - -fail: - av_log(oc, AV_LOG_ERROR, "Failure occurred when starting segment '%s'\n", - oc->filename); - avio_close(oc->pb); - av_freep(&oc->priv_data); - - return err; } static int segment_list_open(AVFormatContext *s) @@ -183,8 +162,7 @@ static int segment_end(AVFormatContext *s) AVFormatContext *oc = seg->avf; int ret = 0; - if (oc->oformat->write_trailer) - ret = oc->oformat->write_trailer(oc); + ret = av_write_trailer(oc); if (ret < 0) av_log(s, AV_LOG_ERROR, "Failure occurred when ending segment '%s'\n", @@ -212,9 +190,6 @@ static int segment_end(AVFormatContext *s) end: avio_close(oc->pb); - if (oc->oformat->priv_class) - av_opt_free(oc->priv_data); - av_freep(&oc->priv_data); return ret; } |