Commits

Anonymous committed 971eddb

CD.play fix

  • Participants
  • Parent commits fa8d6c5

Comments (0)

Files changed (6)

 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+July 24, 2002
+	Ole Martin Bjoerndalen's CD.play fix
+
 July 17, 2002
 	Michael Hudson's unicode cleanups
 
 releases. (hmm, until we get to versions > 10)
 """
 
-ver = '1.5'
+ver = '1.5.1'
 
 <li>Thanks to those sending in patches and fixes:
     Niki Spahiev, Gordon Tyler, Nathaniel Pryce, 
     Dave Wallace, John Popplewell, Michael Urman,
-    Andrew Straw, Michael Hudson</li>
+    Andrew Straw, Michael Hudson, Ole Martin Bjoerndalen</li>
 <li>And our bug hunters above and beyond:
     Angus, Guillaume Proux, Frank Raiser,
     Austin Henry, Kaweh Kazemi, Arturo Aldama,
 
      Thanks to those sending in patches and fixes: Niki Spahiev, Gordon
    Tyler, Nathaniel Pryce, Dave Wallace, John Popplewell, Michael Urman,
-   Andrew Straw, Michael Hudson
+   Andrew Straw, Michael Hudson, Ole Martin Bjoerndalen
 
      And our bug hunters above and beyond: Angus, Guillaume Proux, Frank
    Raiser, Austin Henry, Kaweh Kazemi, Arturo Aldama, Mike Mulcheck, Rene
 
 METADATA = {
     "name":             "pygame",
-    "version":          "1.5",
+    "version":          "1.5.1",
     "license":          "LGPL",
     "url":              "http://www.pygame.org",
     "author":           "Pete Shinners",
 {
 	int cd_id = PyCD_AsID(self);
 	SDL_CD* cdrom = cdrom_drivedata[cd_id];
-	int result, track, startframe, endframe;
+	int result, track, startframe, numframes;
 	float start=0.0f, end=0.0f;
 
 	if(!PyArg_ParseTuple(args, "i|ff", &track, &start, &end))
 
 	/*validate times*/
 	startframe = (int)(start * CD_FPS);
-	endframe = 0;
+	numframes = 0;
 	if(startframe < 0)
 		startframe = 0;
 	if(end)
-		endframe = (int)((end-start) * CD_FPS);
+		numframes = (int)((end-start) * CD_FPS);
 	else
-		endframe = cdrom->track[track].length - startframe;
-	if(endframe < startframe || startframe > (int)(cdrom->track[track].length * CD_FPS))
+		numframes = cdrom->track[track].length - startframe;
+	if(numframes < 0 || startframe > (int)(cdrom->track[track].length * CD_FPS))
 		RETURN_NONE;
 
-	result = SDL_CDPlayTracks(cdrom, track, startframe, 0, endframe);
+	result = SDL_CDPlayTracks(cdrom, track, startframe, 0, numframes);
 	if(result == -1)
 		return RAISE(PyExc_SDLError, SDL_GetError());