Commit 807a1988 authored by Max Kellermann's avatar Max Kellermann

input/CdioParanoia: update offset only after successful seek

If seeking fails, don't leave the class with a wrong offset.
parent df7242de
...@@ -275,12 +275,13 @@ CdioParanoiaInputStream::Seek(std::unique_lock<Mutex> &, ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment