decoder/{dsdiff,dsf,opus}: fix deadlock while seeking

This commit is contained in:
Max Kellermann 2014-11-24 08:54:30 +01:00
parent 716225cd2f
commit 951bad46e0
3 changed files with 5 additions and 3 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.19.5 (not yet released) ver 0.19.5 (not yet released)
* decoder
- dsdiff, dsf, opus: fix deadlock while seeking
ver 0.19.4 (2014/11/18) ver 0.19.4 (2014/11/18)
* protocol * protocol

View File

@ -53,7 +53,7 @@ dsdlib_skip_to(Decoder *decoder, InputStream &is,
offset_type offset) offset_type offset)
{ {
if (is.IsSeekable()) if (is.IsSeekable())
return is.Seek(offset, IgnoreError()); return is.LockSeek(offset, IgnoreError());
if (is.GetOffset() > offset) if (is.GetOffset() > offset)
return false; return false;
@ -72,7 +72,7 @@ dsdlib_skip(Decoder *decoder, InputStream &is,
return true; return true;
if (is.IsSeekable()) if (is.IsSeekable())
return is.Seek(is.GetOffset() + delta, IgnoreError()); return is.LockSeek(is.GetOffset() + delta, IgnoreError());
if (delta > 1024 * 1024) if (delta > 1024 * 1024)
/* don't skip more than one megabyte; it would be too /* don't skip more than one megabyte; it would be too

View File

@ -214,7 +214,7 @@ LoadEOSPacket(InputStream &is, Decoder *decoder, int serialno,
ogg_stream_clear(&os); ogg_stream_clear(&os);
/* restore the previous file position */ /* restore the previous file position */
is.Seek(old_offset, IgnoreError()); is.LockSeek(old_offset, IgnoreError());
return result; return result;
} }