Skip to content

Commit

Permalink
Add fallback for cdio_get_track_last_lsn
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanreg committed Apr 10, 2024
1 parent e792434 commit 67ad970
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cyanrip_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ static int cyanrip_ctx_init(cyanrip_ctx **s, cyanrip_settings *settings)
t->start_lsn = cdio_get_track_lsn(ctx->cdio, t->number);
t->end_lsn = cdio_get_track_last_lsn(ctx->cdio, t->number);

if ((i == (ctx->nb_cd_tracks - 1)) && (t->end_lsn == CDIO_INVALID_LSN)) {
t->end_lsn = ctx->end_lsn;
} else if (t->end_lsn == CDIO_INVALID_LSN) {
cyanrip_log(ctx, 0, "CDIO returned invalid track %i end LSN\n", t->index);
return AVERROR(EINVAL);
}

t->start_lsn_sig = t->start_lsn;
t->end_lsn_sig = t->end_lsn;

Expand Down

0 comments on commit 67ad970

Please sign in to comment.