ext/cdparanoia/gstcdparanoia.c: Fix track calculations (#166208).
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Tue, 8 Feb 2005 11:28:54 +0000 (11:28 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Tue, 8 Feb 2005 11:28:54 +0000 (11:28 +0000)
Original commit message from CVS:
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_convert):
Fix track calculations (#166208).

ChangeLog
ext/cdparanoia/gstcdparanoia.c

index 2056bc94c66700b670eaf3da9c644f5705e65b92..1d2ad85e6bae699c21e1c277dd1b2b7e2755c54a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        Reviewed by:  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
index 23ed90c39c71dfa7339fa50ffa101f8abbb0175f..6909b3689583f22a12ea66eb7f9d1d3db8ae3128 100644 (file)
@@ -1055,10 +1055,11 @@ cdparanoia_convert (GstPad * pad,
             *dest_value = sector;
           } else if (*dest_format == track_format) {
             /* 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);
             else
-              *dest_value = cdda_sector_gettrack (src->d, sector) - 1;
+              *dest_value = cdda_sector_gettrack (src->d,
+                  sector + src->first_sector) - 1;
           } else {
             return FALSE;
           }