Commit 62a22b28 authored by Nicolas Noirbent's avatar Nicolas Noirbent Committed by Michael Niedermayer

segment: fix FPE when segment_list_size is 0

With the added benefit that allowing -segment_list_size 0 makes it
possible to keep all segment entries in the list file.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 645569e1
......@@ -206,7 +206,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
if (seg->list) {
avio_printf(seg->pb, "%s\n", oc->filename);
avio_flush(seg->pb);
if (!(seg->number % seg->size)) {
if (seg->size && !(seg->number % seg->size)) {
avio_close(seg->pb);
if ((ret = avio_open2(&seg->pb, seg->list, AVIO_FLAG_WRITE,
&s->interrupt_callback, NULL)) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment