ext/cdparanoia/gstcdparanoia.c: Fix track calculations (#166208).

Original commit message from CVS:
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_convert):
Fix track calculations (#166208).
This commit is contained in:
Ronald S. Bultje 2005-02-08 11:28:54 +00:00
parent 6dd9f025ef
commit 0d04f83e98
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2005-02-08 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_convert):
Fix track calculations (#166208).
2005-02-08 Gergely Nagy <algernon@bonehunter.rulez.org> 2005-02-08 Gergely Nagy <algernon@bonehunter.rulez.org>
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>

View file

@ -1055,10 +1055,11 @@ cdparanoia_convert (GstPad * pad,
*dest_value = sector; *dest_value = sector;
} else if (*dest_format == track_format) { } else if (*dest_format == track_format) {
/* if we go past the last sector, make sure to report the last track */ /* if we go past the last sector, make sure to report the last track */
if (sector > src->last_sector) if (sector > src->last_sector - src->first_sector)
*dest_value = cdda_sector_gettrack (src->d, src->last_sector); *dest_value = cdda_sector_gettrack (src->d, src->last_sector);
else else
*dest_value = cdda_sector_gettrack (src->d, sector) - 1; *dest_value = cdda_sector_gettrack (src->d,
sector + src->first_sector) - 1;
} else { } else {
return FALSE; return FALSE;
} }