Bugs in [G]TCD



There are a few bugs in the linux-cdrom.c source file of tcd/gtcd which
prevented it from working OMM (LinuxPPC R4).

1. Whenever ioctl is called, there's a check like this:

tmp = ioctl( ... );
if( tmp < 0 )
{
	/* Error */
}

In fact, ioctl can return positive values on errors, too. Only a return
value of zero means that the call was successful, so all of this code
should look like:

tmp = ioctl( ... );
if( tmp )
{
	/* Error */
}

2. When you play the CD, you set the ending msf to the beginning minute,
second, and frame of the track immediately following the last track
being played. It should be subtracting one frame from that ("borrowing"
if necessary).

I'm including a patch for these. Additionally, sometimes the CD audio
just cuts out in the middle of playing and /var/log/messages has a bunch
of kernel messages tagged "scsi:" or "mesh log:" or something like that.
I haven't determined what's causing this yet, but kscd never had that
problem so it's probably not just a kernel bug.

TIA,
Tim
129c129
< 	if( tmp < 0 )
---
> 	if( tmp )
150c150
< 	if( tmp < 0 )
---
> 	if( tmp )
166c166
<                 if( tmp < 0 )
---
>                 if( tmp )
317c317,332
< 		msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame;
---
> 		msf.cdmsf_frame1 = cd->trk[end_t+1].toc.cdte_addr.msf.frame - 1;
> 
> 		if( msf.cdmsf_frame1 < 0 )
> 		{
> 		    msf.cdmsf_sec1 += msf.cdmsf_frame1;
> 		    msf.cdmsf_frame1 = 0;
> 		}
> 		if( msf.cdmsf_sec1 < 0 )
> 		{
> 		    msf.cdmsf_min1 += msf.cdmsf_sec1;
> 		    msf.cdmsf_sec1 = 0;
> 		}
> 		if( msf.cdmsf_min1 < 0 )
> 		{
> 		    msf.cdmsf_min1 = 0;
> 		}
323c338
< 	if( tmp < 0 )
---
> 	if( tmp )
333c348
< 		if( tmp < 0 )
---
> 		if( tmp )
365c380,396
< 	msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame;
---
> 	msf.cdmsf_frame1 = cd->trk[C(cd->last_t+1)].toc.cdte_addr.msf.frame - 1;
> 
> 	if( msf.cdmsf_frame1 < 0 )
> 	{
> 	    msf.cdmsf_sec1 += msf.cdmsf_frame1;
> 	    msf.cdmsf_frame1 = 0;
> 	}
> 	if( msf.cdmsf_sec1 < 0 )
> 	{
> 	    msf.cdmsf_min1 += msf.cdmsf_sec1;
> 	    msf.cdmsf_sec1 = 0;
> 	}
> 	if( msf.cdmsf_min1 < 0 )
> 	{
> 	    msf.cdmsf_min1 = 0;
> 	}
> 	
373c404
<    	if( tmp < 0 )
---
>    	if( tmp )
398c429
< 	if( tmp < 0 )
---
> 	if( tmp )
401c432
<    	if( tmp < 0 )
---
>    	if( tmp )
429c460
<    	if( tmp < 0 )
---
>    	if( tmp )
450c481
< 		if( tmp < 0 )
---
> 		if( tmp )
461c492
< 		if( tmp < 0 )
---
> 		if( tmp )
479c510
< 	if( tmp < 0 )
---
> 	if( tmp )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]