From de86b4a3c5f6e2add2dc7588e6be37c8df2302f0 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Tue, 21 May 2013 22:37:11 +0200 Subject: Opus: fix glitch caused by 2e9aa3d Change-Id: I1519f3bf2cdf74f3d4741951973352b2678b7722 --- lib/rbcodec/codecs/opus.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rbcodec/codecs/opus.c b/lib/rbcodec/codecs/opus.c index 5d7d71dfe0..15d96ff6fe 100644 --- a/lib/rbcodec/codecs/opus.c +++ b/lib/rbcodec/codecs/opus.c @@ -385,18 +385,18 @@ enum codec_status codec_run(void) stream_init = 1; } - /* Do this to avoid allocating space for huge comment packets - (embedded Album Art) */ - if(os.packetno == 1){ - ogg_sync_reset(&oy); - } - /* Add page to the bitstream */ ogg_stream_pagein(&os, &og); page_granule = ogg_page_granulepos(&og); granule_pos = page_granule; + /* Do this to avoid allocating space for huge comment packets + (embedded Album Art) */ + if(os.packetno == 1 && ogg_stream_packetpeek(&os, &op) != 1){ + ogg_sync_reset(&oy); + } + while ((ogg_stream_packetout(&os, &op) == 1) && !op.e_o_s) { if (op.packetno == 0){ /* identification header */ -- cgit v1.2.3