mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-31 04:13:47 +01:00
hopefully make seeking backwards a little safer
git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@136 51a99a44-fe44-0410-b1ba-c3e57ba2b86b
This commit is contained in:
parent
1e4e66ce3f
commit
40e445aae6
@ -361,13 +361,21 @@ DWORD WINAPI __stdcall decode(void *arg) {
|
||||
if (seek_needed_samples != -1) {
|
||||
/* reset if we need to seek backwards */
|
||||
if (seek_needed_samples < decode_pos_samples) {
|
||||
VGMSTREAM * temp;
|
||||
temp = vgmstream;
|
||||
vgmstream = NULL;
|
||||
close_vgmstream(temp);
|
||||
VGMSTREAM * new_temp;
|
||||
VGMSTREAM * old_temp;
|
||||
|
||||
temp = init_vgmstream(lastfn);
|
||||
vgmstream = temp;
|
||||
new_temp = init_vgmstream(lastfn);
|
||||
if (!new_temp) {
|
||||
PostMessage(input_module.hMainWindow, /* message dest */
|
||||
WM_WA_MPEG_EOF, /* message id */
|
||||
0,0); /* no parameters */
|
||||
return 0;
|
||||
}
|
||||
|
||||
old_temp = vgmstream;
|
||||
vgmstream = new_temp;
|
||||
|
||||
close_vgmstream(old_temp);
|
||||
|
||||
decode_pos_samples = 0;
|
||||
decode_pos_ms = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user