input/AsyncInputStream: set Error when seeking unseekable
Fixes crash in the "audiofile" decoder while logging the seek error.
This commit is contained in:
parent
362e73bea8
commit
1bd8a322f5
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.19.3 (not yet released)
|
ver 0.19.3 (not yet released)
|
||||||
|
* decoder
|
||||||
|
- audiofile: fix crash while playing streams
|
||||||
|
|
||||||
ver 0.19.2 (2014/11/02)
|
ver 0.19.2 (2014/11/02)
|
||||||
* input
|
* input
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "AsyncInputStream.hxx"
|
#include "AsyncInputStream.hxx"
|
||||||
|
#include "Domain.hxx"
|
||||||
#include "tag/Tag.hxx"
|
#include "tag/Tag.hxx"
|
||||||
#include "event/Call.hxx"
|
#include "event/Call.hxx"
|
||||||
#include "thread/Cond.hxx"
|
#include "thread/Cond.hxx"
|
||||||
|
@ -113,8 +114,10 @@ AsyncInputStream::Seek(offset_type new_offset, Error &error)
|
||||||
/* no-op */
|
/* no-op */
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!IsSeekable())
|
if (!IsSeekable()) {
|
||||||
|
error.Set(input_domain, "Not seekable");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* check if we can fast-forward the buffer */
|
/* check if we can fast-forward the buffer */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue