mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avformat/segment: Use avformat_alloc_output_context2()
This avoids having to assign oformat, allows returning the correct error code and allocates priv_data Based on patch by: Mika Raento <mika.raento@elisa.fi> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3668168afa
commit
0ffe32cf8f
@ -133,12 +133,13 @@ static int segment_mux_init(AVFormatContext *s)
|
||||
SegmentContext *seg = s->priv_data;
|
||||
AVFormatContext *oc;
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
seg->avf = oc = avformat_alloc_context();
|
||||
if (!oc)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = avformat_alloc_output_context2(&seg->avf, seg->oformat, NULL, NULL);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
oc = seg->avf;
|
||||
|
||||
oc->oformat = seg->oformat;
|
||||
oc->interrupt_callback = s->interrupt_callback;
|
||||
av_dict_copy(&oc->metadata, s->metadata, 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user