mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Fix double write of DASH manifest in streaming mode
When streaming mode is enabled, the DASH manifest is written on the first packet for the segment so that the segment can be advertised immediately to clients. It was also still writing the manifest at the end of the segment leading to two duplicate writes.
This commit is contained in:
parent
ca56299fb3
commit
3f5d5c1c2d
@ -2030,7 +2030,10 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
|
|||||||
|
|
||||||
c->nr_of_streams_flushed = 0;
|
c->nr_of_streams_flushed = 0;
|
||||||
}
|
}
|
||||||
ret = write_manifest(s, final);
|
// In streaming mode the manifest is written at the beginning
|
||||||
|
// of the segment instead
|
||||||
|
if (!c->streaming || final)
|
||||||
|
ret = write_manifest(s, final);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2261,7 +2264,7 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
// in streaming mode, the segments are available for playing
|
// in streaming mode, the segments are available for playing
|
||||||
// before fully written but the manifest is needed so that
|
// before fully written but the manifest is needed so that
|
||||||
// clients and discover the segment filenames.
|
// clients and discover the segment filenames.
|
||||||
if (c->streaming && os->segment_type == SEGMENT_TYPE_MP4) {
|
if (c->streaming) {
|
||||||
write_manifest(s, 0);
|
write_manifest(s, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user