From 1604717cbfc016f58116253b5743d71dc49372f3 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 11 Oct 2004 12:18:42 +0000 Subject: [PATCH] ext/cdparanoia/gstcdparanoia.c: Get rid of hideous lead-in. Original commit message from CVS: * ext/cdparanoia/gstcdparanoia.c: (cdparanoia_open), (cdparanoia_event), (cdparanoia_query): Get rid of hideous lead-in. --- ChangeLog | 6 ++++++ ext/cdparanoia/gstcdparanoia.c | 17 +++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 85c9632799..d970ef518f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-11 Ronald S. Bultje + + * ext/cdparanoia/gstcdparanoia.c: (cdparanoia_open), + (cdparanoia_event), (cdparanoia_query): + Get rid of hideous lead-in. + 2004-10-11 Wim Taymans * gst/playback/gstplaybasebin.c: (setup_source): diff --git a/ext/cdparanoia/gstcdparanoia.c b/ext/cdparanoia/gstcdparanoia.c index f1a95f64f6..c15bf679d7 100644 --- a/ext/cdparanoia/gstcdparanoia.c +++ b/ext/cdparanoia/gstcdparanoia.c @@ -729,8 +729,8 @@ cdparanoia_open (CDParanoia * src) cdda_speed_set (src->d, src->read_speed); } - /* save thse ones */ - src->first_sector = cdda_disc_firstsector (src->d); + /* save thse ones - skip lead-in */ + src->first_sector = cdda_track_firstsector (src->d, 1); src->last_sector = cdda_disc_lastsector (src->d); /* this is the default segment we will play */ @@ -911,6 +911,7 @@ cdparanoia_event (GstPad * pad, GstEvent * event) } /* do we need to update the start sector? */ if (seg_start_sector != -1) { + seg_start_sector += src->first_sector; seg_start_sector = CLAMP (seg_start_sector, src->first_sector, src->last_sector); @@ -924,6 +925,7 @@ cdparanoia_event (GstPad * pad, GstEvent * event) } } if (seg_end_sector != -1) { + seg_end_sector += src->first_sector; seg_end_sector = CLAMP (seg_end_sector, src->first_sector, src->last_sector); src->segment_end_sector = seg_end_sector; @@ -1101,20 +1103,23 @@ cdparanoia_query (GstPad * pad, GstQueryType type, /* we take the last sector + 1 so that we also have the full * size of that last sector */ res = gst_pad_convert (src->srcpad, - sector_format, src->last_sector + 1, format, value); + sector_format, src->last_sector + 1 - src->first_sector, + format, value); break; case GST_QUERY_POSITION: /* bring our current sector to the requested format */ res = gst_pad_convert (src->srcpad, - sector_format, src->cur_sector, format, value); + sector_format, src->cur_sector - src->first_sector, format, value); break; case GST_QUERY_START: res = gst_pad_convert (src->srcpad, - sector_format, src->segment_start_sector, format, value); + sector_format, src->segment_start_sector - src->first_sector, + format, value); break; case GST_QUERY_SEGMENT_END: res = gst_pad_convert (src->srcpad, - sector_format, src->segment_end_sector, format, value); + sector_format, src->segment_end_sector - src->first_sector, + format, value); break; default: res = FALSE;