aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2010-03-12 05:17:01 +0000
committerDavid Conrad <lessen42@gmail.com>2010-03-12 05:17:01 +0000
commit81b743eb1026547270b88ac6a5cb451a3907ee94 (patch)
tree02c6f6ecdf88081940e9d2b0ef5f06a75530f72f
parent8730fad595f5f391de21f6b41d04e22a4412e14e (diff)
downloadffmpeg-81b743eb1026547270b88ac6a5cb451a3907ee94.tar.gz
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. Originally committed as revision 22478 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/oggdec.c15
-rw-r--r--libavformat/oggdec.h1
2 files changed, 6 insertions, 10 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index fda1eb2633..d2bc085c04 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -364,21 +364,19 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
ogg->curidx = idx;
os->incomplete = 0;
- if (!ogg->headers){
- int hdr = os->codec->header (s, idx);
- os->header = os->seq;
- if (!hdr){
+ if (os->header) {
+ os->header = os->codec->header (s, idx);
+ if (!os->header){
os->segp = segp;
os->psize = psize;
+ if (!ogg->headers)
+ s->data_offset = os->sync_pos;
ogg->headers = 1;
- s->data_offset = os->sync_pos;
}else{
os->pstart += os->psize;
os->psize = 0;
}
- }
-
- if (os->header > -1 && os->seq > os->header){
+ } else {
os->pflags = 0;
os->pduration = 0;
if (os->codec && os->codec->packet)
@@ -405,7 +403,6 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
break;
}
- os->seq++;
if (os->segp == os->nsegs)
ogg->curidx = -1;
diff --git a/libavformat/oggdec.h b/libavformat/oggdec.h
index e404e586ff..1aecd83d5a 100644
--- a/libavformat/oggdec.h
+++ b/libavformat/oggdec.h
@@ -62,7 +62,6 @@ struct ogg_stream {
unsigned int pflags;
unsigned int pduration;
uint32_t serial;
- uint32_t seq;
uint64_t granule;
int64_t lastpts;
int64_t lastdts;