Commit 59eba300 authored by conrad's avatar conrad

oggdec: Pass packets to header() until the stream is done with them

This fixes some old ogm files that had the 3rd vorbis header after a data
packet in another stream. This is invalid in ogg, but this change shouldn't
affect the behaviour of any valid file.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22478 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent cbc7790b
...@@ -364,21 +364,19 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo ...@@ -364,21 +364,19 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
ogg->curidx = idx; ogg->curidx = idx;
os->incomplete = 0; os->incomplete = 0;
if (!ogg->headers){ if (os->header) {
int hdr = os->codec->header (s, idx); os->header = os->codec->header (s, idx);
os->header = os->seq; if (!os->header){
if (!hdr){
os->segp = segp; os->segp = segp;
os->psize = psize; os->psize = psize;
ogg->headers = 1; if (!ogg->headers)
s->data_offset = os->sync_pos; s->data_offset = os->sync_pos;
ogg->headers = 1;
}else{ }else{
os->pstart += os->psize; os->pstart += os->psize;
os->psize = 0; os->psize = 0;
} }
} } else {
if (os->header > -1 && os->seq > os->header){
os->pflags = 0; os->pflags = 0;
os->pduration = 0; os->pduration = 0;
if (os->codec && os->codec->packet) if (os->codec && os->codec->packet)
...@@ -405,7 +403,6 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo ...@@ -405,7 +403,6 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
break; break;
} }
os->seq++;
if (os->segp == os->nsegs) if (os->segp == os->nsegs)
ogg->curidx = -1; ogg->curidx = -1;
......
...@@ -62,7 +62,6 @@ struct ogg_stream { ...@@ -62,7 +62,6 @@ struct ogg_stream {
unsigned int pflags; unsigned int pflags;
unsigned int pduration; unsigned int pduration;
uint32_t serial; uint32_t serial;
uint32_t seq;
uint64_t granule; uint64_t granule;
int64_t lastpts; int64_t lastpts;
int64_t lastdts; int64_t lastdts;
......
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