Skip track if returned LSNs are negative which indicates track errors or if track is not an audio track
This commit is contained in:
parent
9d853897cd
commit
c00d217a53
|
@ -264,6 +264,16 @@ input_cdio_open(const char *uri,
|
|||
lsn_to = cdio_cddap_disc_lastsector(drv);
|
||||
}
|
||||
|
||||
/* LSNs < 0 indicate errors (e.g. -401: Invaid track, -402: no pregap) */
|
||||
if(lsn_from < 0 || lsn_to < 0)
|
||||
throw FmtRuntimeError("Error {} on track {}",
|
||||
lsn_from < 0 ? lsn_from : lsn_to, parsed_uri.track);
|
||||
|
||||
/* Only check for audio track if not pregap or whole CD */
|
||||
if (!cdio_cddap_track_audiop(drv, parsed_uri.track) && parsed_uri.track > 0)
|
||||
throw FmtRuntimeError("No audio track: {}",
|
||||
parsed_uri.track);
|
||||
|
||||
return std::make_unique<CdioParanoiaInputStream>(uri, mutex,
|
||||
drv, cdio,
|
||||
reverse_endian,
|
||||
|
|
Loading…
Reference in New Issue