Merging commit d7b542ae from FFmpeg:
Fixes trac issue #438.
Seeking in that sample would cause ogg_read_timestamp to fail
because ogg_packet would go into a state where all packets
of stream 1 would be discarded until the end of the stream.
FFmpeg patch by: Reimar Döffinger <[email protected]>
Bug-Id: 553
---
libavformat/oggdec.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 6514c5b..eda9565 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -296,6 +296,9 @@ static int ogg_read_page(AVFormatContext *s, int *str)
if (flags & OGG_FLAG_CONT || os->incomplete) {
if (!os->psize) {
while (os->segp < os->nsegs) {
+ // If this is the very first segment we started
+ // playback in the middle of a continuation packet.
+ // Discard it since we missed the start of it.
int seg = os->segments[os->segp++];
os->pstart += seg;
if (seg < 255)
@@ -384,7 +387,11 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
if (!complete && os->segp == os->nsegs) {
ogg->curidx = -1;
- os->incomplete = 1;
+ // Do not set incomplete for empty packets.
+ // Together with the code in ogg_read_page
+ // that discards all continuation of empty packets
+ // we would get an infinite loop.
+ os->incomplete = !!os->psize;
}
} while (!complete);
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel