input/CdioParanoia: update offset only after successful seek
If seeking fails, don't leave the class with a wrong offset.
This commit is contained in:
parent
df7242de91
commit
807a19889f
@ -275,12 +275,13 @@ CdioParanoiaInputStream::Seek(std::unique_lock<Mutex> &,
|
|||||||
|
|
||||||
/* calculate current LSN */
|
/* calculate current LSN */
|
||||||
const int32_t lsn_relofs = new_offset / CDIO_CD_FRAMESIZE_RAW;
|
const int32_t lsn_relofs = new_offset / CDIO_CD_FRAMESIZE_RAW;
|
||||||
offset = new_offset;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const ScopeUnlock unlock(mutex);
|
const ScopeUnlock unlock(mutex);
|
||||||
para.Seek(lsn_from + lsn_relofs);
|
para.Seek(lsn_from + lsn_relofs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
offset = new_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
|
Loading…
Reference in New Issue
Block a user