[MPlayer-dev-eng] [PATCH] CDDA Shuffle Mode

Ryan M Harris ryan.harris at acm.org
Sat Jun 21 22:24:29 CEST 2003


Hi,

I am hoping this is the correct place to be sending this.

Below is a patch to fix shuffle mode for audio CDs.  Before it would do:

3->end of cd (3-7 let's say)
1->end of cd (1-7)
2->end of cd (2-7)

With this patch it does it correctly (3, 1, 2)

If this is not correct, please give me a holler.


Regards,

Ryan M Harris
ryan.harris at acm.org


======================

diff -r -U2 MPlayer-20030621/libmpdemux/cdda.c
MPlayer-20030621.patched/libmpdemux/cdda.c
--- MPlayer-20030621/libmpdemux/cdda.c  2003-05-17 08:24:01 -0400
+++ MPlayer-20030621.patched/libmpdemux/cdda.c  2003-06-21 14:31:43
-0400
@@ -34,5 +34,5 @@
   0,
   DEFAULT_CDROM_DEVICE,
-  { 0, 0 }
+  { 0, -1 }
 };
                                                                                                                                                                            
@@ -178,10 +178,19 @@
     priv->start_sector = cdda_disc_firstsector(cdd);
                                                                                                                                                                            
-  if(p->span.end) {
+
+  // set span.end if span.start is set and span.end is not.
+
+  if(p->span.end > 0) {
     int last = cdda_tracks(cdd);
     if(p->span.end > last) p->span.end = last;
     priv->end_sector = cdda_track_lastsector(cdd,p->span.end);
-  } else
+  } else if (p->span.start != 0 && p->span.end == -1) {
+    p->span.end = p->span.start;
+    priv->end_sector = cdda_track_lastsector(cdd,p->span.end);
+  } else {
+    p->span.end = 0;
     priv->end_sector = cdda_disc_lastsector(cdd);
+  }
+
                                                                                                                                                                            
   priv->cdp = paranoia_init(cdd);





More information about the MPlayer-dev-eng mailing list