From 9974ea4657434307e53c4efb4f15a3e83d57b97a Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Mon, 14 Jan 2002 21:42:59 +0000 Subject: Fixed cda deadlocks. CVS patchset: 1404 CVS date: 2002/01/14 21:42:59 --- src/demuxers/demux_cda.c | 3 +-- src/input/input_cda.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_cda.c b/src/demuxers/demux_cda.c index 2a916f947..a585a988b 100644 --- a/src/demuxers/demux_cda.c +++ b/src/demuxers/demux_cda.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_cda.c,v 1.5 2002/01/02 18:16:07 jkeil Exp $ + * $Id: demux_cda.c,v 1.6 2002/01/14 21:42:59 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -99,7 +99,6 @@ static int demux_cda_next (demux_cda_t *this) { buf->input_time = buf->input_pos / this->blocksize; buf->type = BUF_VIDEO_FILL; /* Fake */ - // if(this->audio_fifo) this->video_fifo->put(this->video_fifo, buf); return ((pos < len)); diff --git a/src/input/input_cda.c b/src/input/input_cda.c index 9034921bb..232a55a81 100644 --- a/src/input/input_cda.c +++ b/src/input/input_cda.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_cda.c,v 1.14 2002/01/02 18:16:07 jkeil Exp $ + * $Id: input_cda.c,v 1.15 2002/01/14 21:43:00 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -1414,7 +1414,8 @@ static int cda_plugin_open (input_plugin_t *this_gen, char *mrl) { return 0; } - if((_cda_is_cd_changed(this->cda) == 1) && (this->cda->num_tracks)) { + if(((_cda_is_cd_changed(this->cda) == 1) && (this->cda->num_tracks)) + || ((_cda_is_cd_changed(this->cda) == -1) && (!this->cda->num_tracks))) { if(!_cda_read_toc_cd(this->cda)) { _cda_free_cda(this->cda); return 0; @@ -1533,7 +1534,7 @@ static off_t cda_plugin_get_length (input_plugin_t *this_gen) { _ENTER_FUNC(); _LEAVE_FUNC(); - return (this->cda->track[this->cda->cur_track-1].length * CDA_BLOCKSIZE); + return (this->cda->track[this->cda->cur_track-1].length * CDA_BLOCKSIZE) - CDA_BLOCKSIZE; } /* @@ -1547,12 +1548,15 @@ static off_t cda_plugin_get_current_pos (input_plugin_t *this_gen){ _cda_get_status_cd(this->cda); #ifdef DEBUG_POS - printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b(%02d:%02d:%02d) (%d)%02d", + printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b(%02d:%02d:%02d) (%d)%02d - %d/%d[%d/%d]\n", (this->cda->cur_pos / (60 * 60)), ((this->cda->cur_pos / 60) % 60), (this->cda->cur_pos %60), this->cda->cur_track-1, - this->cda->track[this->cda->cur_track-1].length); + this->cda->track[this->cda->cur_track-1].length, + this->cda->cur_pos * CDA_BLOCKSIZE, + this->cda->track[this->cda->cur_track-1].length * CDA_BLOCKSIZE, + this->cda->cur_pos, this->cda->track[this->cda->cur_track-1].length); #endif _LEAVE_FUNC(); -- cgit v1.2.3