summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2013-05-19 14:16:22 +0200
committerNils Wallménius <nils@rockbox.org>2013-05-19 14:20:31 +0200
commita17d6de5bc727b0bb55764ecef2605ae689e8dab (patch)
treedd645a37609d3b7909775393b686f661736f4a10 /lib
parent2e9aa3d8b04ff56fad4ffb2f855e40dfffbd827b (diff)
downloadrockbox-a17d6de5bc727b0bb55764ecef2605ae689e8dab.tar.gz
rockbox-a17d6de5bc727b0bb55764ecef2605ae689e8dab.tar.bz2
rockbox-a17d6de5bc727b0bb55764ecef2605ae689e8dab.zip
Opus: fix seeking to start of track
Change-Id: I8a8604d6726304d04281671b475b2f75f9bfc0e5
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/codecs/opus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbcodec/codecs/opus.c b/lib/rbcodec/codecs/opus.c
index 86ddb31936..5d7d71dfe0 100644
--- a/lib/rbcodec/codecs/opus.c
+++ b/lib/rbcodec/codecs/opus.c
@@ -188,7 +188,7 @@ static int64_t seek_backwards(ogg_sync_state *oy, ogg_page *og,
}
static int speex_seek_page_granule(int64_t pos, int64_t curpos,
- ogg_sync_state *oy)
+ ogg_sync_state *oy, ogg_stream_state *os)
{
/* TODO: Someone may want to try to implement seek to packet,
instead of just to page (should be more accurate, not be any
@@ -257,6 +257,7 @@ static int speex_seek_page_granule(int64_t pos, int64_t curpos,
*curbyteoffset = 0;
ci->seek_buffer(*curbyteoffset);
ogg_sync_reset(oy);
+ ogg_stream_reset(os);
return 0;
} else if (curpos > pos) { /* backwards */
offset = seek_backwards(oy,&og,pos);
@@ -365,7 +366,7 @@ enum codec_status codec_run(void)
LOGF("Opus seek page:%lld,%lld,%ld\n",
seek_target, page_granule, (long)param);
- speex_seek_page_granule(seek_target, page_granule, &oy);
+ speex_seek_page_granule(seek_target, page_granule, &oy, &os);
}
ci->set_elapsed(param);