mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
oggdec: Fix incorrect assumption about header/data interleaving
Currently (since the data_offset fix) the ogg demuxer assumes that
after the first non-header packets in any stream no more header packets
will follow.
This is not guaranteed, so change the code back again to wait until it
has finished the headers for all streams before returning from ogg_get_headers.
This fixes issue 2428.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 6bd69e6ada
)
This commit is contained in:
parent
68b2336d13
commit
94dfea71ed
@ -374,20 +374,20 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
|
|||||||
os->segp = segp;
|
os->segp = segp;
|
||||||
os->psize = psize;
|
os->psize = psize;
|
||||||
|
|
||||||
// We have reached the first non-header packet. All header
|
// We have reached the first non-header packet in this stream.
|
||||||
// packets must be complete before the first non-header
|
// Unfortunately more header packets may still follow for others,
|
||||||
// one, so everything that follows must be non-header.
|
// so we reset this later unless we are done with the headers
|
||||||
|
// for all streams.
|
||||||
ogg->headers = 1;
|
ogg->headers = 1;
|
||||||
|
|
||||||
// Update the header state for all streams and
|
// Update the header state for all streams and
|
||||||
// compute the data_offset.
|
// compute the data_offset.
|
||||||
s->data_offset = os->sync_pos;
|
if (!s->data_offset)
|
||||||
|
s->data_offset = os->sync_pos;
|
||||||
for (i = 0; i < ogg->nstreams; i++) {
|
for (i = 0; i < ogg->nstreams; i++) {
|
||||||
struct ogg_stream *cur_os = ogg->streams + i;
|
struct ogg_stream *cur_os = ogg->streams + i;
|
||||||
// Set stream header state to 0 if its last packet
|
|
||||||
// was a header.
|
|
||||||
if (cur_os->header > 0)
|
if (cur_os->header > 0)
|
||||||
cur_os->header = 0;
|
ogg->headers = 0;
|
||||||
|
|
||||||
// if we have a partial non-header packet, its start is
|
// if we have a partial non-header packet, its start is
|
||||||
// obviously at or after the data start
|
// obviously at or after the data start
|
||||||
|
Loading…
Reference in New Issue
Block a user