input/CdioParanoia: eliminate redundant field "lsn_relofs"

This commit is contained in:
Max Kellermann 2022-07-08 12:37:53 +02:00
parent d62426f168
commit df7242de91

View File

@ -51,7 +51,6 @@ class CdioParanoiaInputStream final : public InputStream {
CdromParanoia para; CdromParanoia para;
const lsn_t lsn_from; const lsn_t lsn_from;
int lsn_relofs;
char buffer[CDIO_CD_FRAMESIZE_RAW]; char buffer[CDIO_CD_FRAMESIZE_RAW];
int buffer_lsn; int buffer_lsn;
@ -64,7 +63,6 @@ class CdioParanoiaInputStream final : public InputStream {
:InputStream(_uri, _mutex), :InputStream(_uri, _mutex),
drv(_drv), cdio(_cdio), para(drv), drv(_drv), cdio(_cdio), para(drv),
lsn_from(_lsn_from), lsn_from(_lsn_from),
lsn_relofs(0),
buffer_lsn(-1) buffer_lsn(-1)
{ {
/* Set reading mode for full paranoia, but allow /* Set reading mode for full paranoia, but allow
@ -276,7 +274,7 @@ CdioParanoiaInputStream::Seek(std::unique_lock<Mutex> &,
return; return;
/* calculate current LSN */ /* calculate current LSN */
lsn_relofs = new_offset / CDIO_CD_FRAMESIZE_RAW; const int32_t lsn_relofs = new_offset / CDIO_CD_FRAMESIZE_RAW;
offset = new_offset; offset = new_offset;
{ {
@ -299,6 +297,8 @@ CdioParanoiaInputStream::Read(std::unique_lock<Mutex> &,
//current sector was changed ? //current sector was changed ?
const int16_t *rbuf; const int16_t *rbuf;
const int32_t lsn_relofs = offset / CDIO_CD_FRAMESIZE_RAW;
if (lsn_relofs != buffer_lsn) { if (lsn_relofs != buffer_lsn) {
const ScopeUnlock unlock(mutex); const ScopeUnlock unlock(mutex);
@ -339,7 +339,6 @@ CdioParanoiaInputStream::Read(std::unique_lock<Mutex> &,
//update offset //update offset
offset += len; offset += len;
lsn_relofs = offset / CDIO_CD_FRAMESIZE_RAW;
//update length //update length
length -= len; length -= len;
} }