diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-11 04:02:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-11 04:08:08 +0200 |
commit | ab8cfd45f8dcff5a9d60271b30dc4437756d5985 (patch) | |
tree | 0f74fb858daf39079fcca2a7ebde67676234ceec /libavformat/oggdec.c | |
parent | 2e92a34cde07ea145e4b8380259881988cf7edd3 (diff) | |
parent | d1c5fdf8920b75f3b824368b8336f18c74b68803 (diff) | |
download | ffmpeg-ab8cfd45f8dcff5a9d60271b30dc4437756d5985.tar.gz |
Merge remote branch 'qatar/master'
* qatar/master:
avio: add more documentation for AVIOContext.
Parse sprite data for WMVP and WVP2, and decode sprites for the latter
Replace outdated info on the FAQ
Redefine sameq
pad: fix example explanation
gradfun: add notice from the MPlayer manual
eval: add support for trunc, ceil, and floor functions
documentation: add setdar and setsar description to filters.texi
avio: document some members of AVIOContext.
avio: document avio_close().
avio: cosmetics, vertically align comments.
avio: cosmetics, group the reading functions.
avio: cosmetics, merge all the FF_API_OLD_AVIO blocks.
avio: cosmetics, move AVIOContext to start of the file.
avio: update file header.
os: fix OpenBSD/PowerPC compilation
pixfmt: add PIX_FMT_BGR48LE and PIX_FMT_BGR48BE
oggdec: fix demuxing chained audio streams
fix typo
Conflicts:
doc/filters.texi
libavformat/avio.h
libavutil/pixfmt.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r-- | libavformat/oggdec.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 148505aa10..e32f8029e0 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -164,6 +164,7 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial) os->bufsize = DECODER_BUFFER_SIZE; os->buf = av_malloc(os->bufsize); os->header = -1; + os->page_begin = 1; st = av_new_stream (s, idx); if (!st) @@ -241,12 +242,27 @@ ogg_read_page (AVFormatContext * s, int *str) idx = ogg_find_stream (ogg, serial); if (idx < 0){ + for (i = 0; i < ogg->nstreams; i++) { + if (!ogg->streams[i].page_begin) { + int n; + + for (n = 0; n < ogg->nstreams; n++) { + av_free(ogg->streams[n].buf); + av_free(ogg->streams[n].private); + } + ogg->curidx = -1; + ogg->nstreams = 0; + break; + } + } idx = ogg_new_stream (s, serial); if (idx < 0) return -1; } os = ogg->streams + idx; + if (!(flags & OGG_FLAG_BOS)) + os->page_begin = 0; os->page_pos = avio_tell(bc) - 27; if(os->psize > 0) |