minimp3: Fix seeking behavior
Seeking should clear the sample buffer if it contains anything, and non- seekable files should return an error on an attempt to seek. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
11eeaea6e2
commit
6e8538c7c9
1 changed files with 3 additions and 0 deletions
|
@ -290,6 +290,9 @@ static int mp3_seek_callback(uint64_t position, void *user_data) {
|
||||||
if(error < 0) {
|
if(error < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
samples_filled = 0;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
seconds = (double)frame / (double)_decoder_info.hz;
|
seconds = (double)frame / (double)_decoder_info.hz;
|
||||||
|
|
Loading…
Reference in a new issue