decoder/{dsdiff,dsf,opus}: fix deadlock while seeking
This commit is contained in:
parent
716225cd2f
commit
951bad46e0
2
NEWS
2
NEWS
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue