summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2019-08-12 22:57:37 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2019-08-14 17:54:35 +0200
commit0ff6a31d7dc51ff2f0a6147a0fadff2d6359ecb9 (patch)
treea29f97d44d576825669f69f6340e9234f1d64c27 /lib
parent8570d4063b2c63482ceb986a2735f247e736c010 (diff)
downloadrockbox-0ff6a31d7dc51ff2f0a6147a0fadff2d6359ecb9.tar.gz
rockbox-0ff6a31d7dc51ff2f0a6147a0fadff2d6359ecb9.zip
opus reset decoder on seek completion to prevent stack overflow
apparently we should be doing this anyway mark4o> The packets overlap and may reuse state set by other recent packets, so if you seek to a different position, resetting the state helps to ensure that the subsequent packets won't use the state set by the unrelated packets that were processed before the seek. remove stack bump WORKAROUND_FS13060 Change-Id: I1c14e23b1721a360b91e3e55202c1557aef0fcc6
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/codecs/opus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/opus.c b/lib/rbcodec/codecs/opus.c
index f0ad5e8ba4..c34c0b885b 100644
--- a/lib/rbcodec/codecs/opus.c
+++ b/lib/rbcodec/codecs/opus.c
@@ -413,6 +413,9 @@ enum codec_status codec_run(void)
LOGF("Opus seek page:%lld,%lld,%ld\n",
seek_target, page_granule, (long)param);
opus_seek_page_granule(seek_target, page_granule, &oy, &os);
+ /* reset the state to help ensure that subsequent packets won't
+ use state set by unrelated packets processed before seek */
+ opus_decoder_ctl(st, OPUS_RESET_STATE);
}
ci->set_elapsed(param);