From: Tim C. <tc...@us...> - 2003-06-09 01:26:28
|
Update of /cvsroot/xine/xine-lib/src/input In directory sc8-pr-cvs1:/tmp/cvs-serv12936/src/input Modified Files: input_cdda.c Log Message: I think that this should fix the cdda plugin. Can someone verify this? Thanks to Miguel for helping me understand the problem. Index: input_cdda.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/input/input_cdda.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- input_cdda.c 9 Jun 2003 00:37:27 -0000 1.27 +++ input_cdda.c 9 Jun 2003 01:26:25 -0000 1.28 @@ -1935,22 +1935,28 @@ #ifndef WIN32 - this_gen->fd = -1; + if (this_gen) + this_gen->fd = -1; fd = open (cdda_device, O_RDONLY); if (fd == -1) { return -1; } - this_gen->fd = fd; -#else /* WIN32 */ + if (this_gen) + this_gen->fd = fd; - this_gen->fd = -1; - this_gen->h_device_handle = NULL; - this_gen->i_sid = 0; - this_gen->hASPI = 0; - this_gen->lpSendCommand = 0; +#else /* WIN32 */ + if (this_gen) { + this_gen->fd = -1; + this_gen->h_device_handle = NULL; + this_gen->i_sid = 0; + this_gen->hASPI = 0; + this_gen->lpSendCommand = 0; + } + else + return -1; /* We are going to assume that we are opening a * device and not a file! @@ -2100,6 +2106,9 @@ static int cdda_close(cdda_input_plugin_t *this_gen) { + if (!this_gen) + return 0; + if( this_gen->fd != -1 ) close(this_gen->fd); this_gen->fd = -1; @@ -2437,13 +2446,9 @@ #endif if (fd == -1) { - if (ip) { - if (cdda_open(ip, ip->cdda_device, &toc) == -1) { - return NULL; - } + if (cdda_open(ip, this->cdda_device, &toc) == -1) { + return NULL; } - else - return NULL; } |