diff options
-rw-r--r-- | src/input/vcd/vcdio.c | 8 | ||||
-rw-r--r-- | src/input/vcd/vcdio.h | 4 | ||||
-rw-r--r-- | src/input/vcd/vcdplayer.c | 28 | ||||
-rw-r--r-- | src/input/vcd/xineplug_inp_vcd.c | 35 |
4 files changed, 35 insertions, 40 deletions
diff --git a/src/input/vcd/vcdio.c b/src/input/vcd/vcdio.c index b93b19796..7835c67b5 100644 --- a/src/input/vcd/vcdio.c +++ b/src/input/vcd/vcdio.c @@ -1,7 +1,7 @@ /* - $Id: vcdio.c,v 1.5 2005/01/02 02:51:38 rockyb Exp $ + $Id: vcdio.c,v 1.6 2005/01/08 15:12:42 rockyb Exp $ - Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com> + Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,8 +103,8 @@ vcdio_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device) } } - if ( vcdinfo_open(&p_vcdplayer->vcd, &intended_vcd_device, DRIVER_UNKNOWN, NULL) != - VCDINFO_OPEN_VCD) { + if ( vcdinfo_open(&p_vcdplayer->vcd, &intended_vcd_device, DRIVER_UNKNOWN, + NULL) != VCDINFO_OPEN_VCD) { return false; } diff --git a/src/input/vcd/vcdio.h b/src/input/vcd/vcdio.h index e05bb2ed1..bd9daf3b6 100644 --- a/src/input/vcd/vcdio.h +++ b/src/input/vcd/vcdio.h @@ -1,7 +1,7 @@ /* - $Id: vcdio.h,v 1.2 2004/12/29 09:23:56 rockyb Exp $ + $Id: vcdio.h,v 1.3 2005/01/08 15:12:42 rockyb Exp $ - Copyright (C) 2002, 2004 Rocky Bernstein <rocky@panix.com> + Copyright (C) 2002, 2004, 2005 Rocky Bernstein <rocky@panix.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/src/input/vcd/vcdplayer.c b/src/input/vcd/vcdplayer.c index 7a0c220b0..408aff6e3 100644 --- a/src/input/vcd/vcdplayer.c +++ b/src/input/vcd/vcdplayer.c @@ -1,5 +1,5 @@ /* - $Id: vcdplayer.c,v 1.14 2005/01/08 11:59:27 rockyb Exp $ + $Id: vcdplayer.c,v 1.15 2005/01/08 15:12:42 rockyb Exp $ Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> @@ -538,6 +538,9 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid) case VCDINFO_FILES_VIDEO_NTSC_STILL2: case VCDINFO_FILES_VIDEO_PAL_STILL: case VCDINFO_FILES_VIDEO_PAL_STILL2: + /* Note that we are reading a still frame but haven't + got to the end. + */ p_vcdplayer->i_still = STILL_READING; break; default: @@ -653,10 +656,10 @@ vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid) uint16_t trans_itemid_num; if (p_vcdplayer->pxd.psd == NULL) return; - trans_itemid_num = vcdinf_psd_get_itemid(p_vcdplayer->pxd.psd); + trans_itemid_num = vcdinf_psd_get_itemid(p_vcdplayer->pxd.psd); vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid); - p_vcdplayer->i_loop = 1; - p_vcdplayer->loop_item = trans_itemid; + p_vcdplayer->i_loop = 1; + p_vcdplayer->loop_item = trans_itemid; vcdplayer_play_single_item(p_vcdplayer, trans_itemid); break; } @@ -718,7 +721,7 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf) "continuing into next entry: %u\n", p_vcdplayer->play_item.num); vcdplayer_play_single_item(p_vcdplayer, p_vcdplayer->play_item); p_vcdplayer->update_title(); - goto skip_next_play; + return READ_BLOCK; } switch (p_vcdplayer->pxd.descriptor_type) { @@ -731,7 +734,7 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf) dbg_print(INPUT_DBG_PBC, "playlist wait_time: %d\n", wait_time); if (_vcdplayer_inc_play_item(p_vcdplayer)) - goto skip_next_play; + return READ_BLOCK; /* This needs to be improved in libvcdinfo when I get around to it. */ @@ -768,7 +771,7 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf) if (p_vcdplayer->i_loop == 0x7f) p_vcdplayer->i_loop = 0; vcdplayer_play_single_item(p_vcdplayer, p_vcdplayer->loop_item); if (p_vcdplayer->i_still) p_vcdplayer->force_redisplay(); - goto skip_next_play; + return READ_BLOCK; } /* Looping finished and wait finished. Move to timeout @@ -780,7 +783,7 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf) itemid.type = VCDINFO_ITEM_TYPE_LID; dbg_print(INPUT_DBG_PBC, "timeout to: %d\n", itemid.num); vcdplayer_play(p_vcdplayer, itemid); - goto skip_next_play; + return READ_BLOCK; } else { int i_selections = vcdinf_get_num_selections(p_vcdplayer->pxd.psd); if (i_selections > 0) { @@ -788,18 +791,16 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf) unsigned int bsn=vcdinf_get_bsn(p_vcdplayer->pxd.psd); int rand_selection=bsn + (int) ((i_selections+0.0)*rand()/(RAND_MAX+1.0)); - - /* version 0.7.21 or greater */ lid_t rand_lid=vcdinfo_selection_get_lid(p_vcdplayer->vcd, - p_vcdplayer->i_lid, + p_vcdplayer->i_lid, rand_selection); itemid.num = rand_lid; itemid.type = VCDINFO_ITEM_TYPE_LID; dbg_print(INPUT_DBG_PBC, "random selection %d, lid: %d\n", rand_selection - bsn, rand_lid); vcdplayer_play(p_vcdplayer, itemid); - goto skip_next_play; - } else if (p_vcdplayer->i_still) { + return READ_BLOCK; + } else if (p_vcdplayer->i_still > 0) { /* Hack: Just go back and do still again */ RETURN_NULL_STILL ; } @@ -824,7 +825,6 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf) itemid.num = p_vcdplayer->next_entry; itemid.type = VCDINFO_ITEM_TYPE_LID; vcdplayer_play(p_vcdplayer, itemid); - skip_next_play: ; return READ_BLOCK; } diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index 023632930..32d7c5b94 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -1,5 +1,5 @@ /* - $Id: xineplug_inp_vcd.c,v 1.32 2005/01/08 11:59:27 rockyb Exp $ + $Id: xineplug_inp_vcd.c,v 1.33 2005/01/08 15:12:43 rockyb Exp $ Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com> @@ -623,10 +623,10 @@ vcd_plugin_read (input_plugin_t *this_gen, char *buf, const off_t nlen) to do nothing, but in contrast to returning NULL, it doesn't mean the stream has ended. We use this say for still frames. */ -#define RETURN_NOOP_BUF \ - buf = fifo->buffer_pool_alloc (fifo); \ - buf->type = BUF_CONTROL_NOP; \ - return buf +#define RETURN_NOOP_BUF \ + p_buf = fifo->buffer_pool_alloc (fifo); \ + p_buf->type = BUF_CONTROL_NOP; \ + return p_buf /* Handle keyboard events and if there were non which might affect playback, then sleep a little bit and return; @@ -646,12 +646,12 @@ vcd_plugin_read (input_plugin_t *this_gen, char *buf, const off_t nlen) */ static buf_element_t * vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, - const off_t nlen) + const off_t nlen) { vcd_input_plugin_t *vcd_input_plugin= (vcd_input_plugin_t *) this_gen; - vcdplayer_t *p_vcdplayer = &my_vcd.player; - buf_element_t *buf; - uint8_t data[M2F2_SECTOR_SIZE]; + vcdplayer_t *p_vcdplayer = &my_vcd.player; + buf_element_t *p_buf; + uint8_t data[M2F2_SECTOR_SIZE] = {0}; if (fifo == NULL) { dbg_print(INPUT_DBG_CALL, "NULL fifo"); @@ -689,9 +689,6 @@ vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, case READ_ERROR: /* Some sort of error. */ return NULL; -#if INACCURATE_STILL_TIME - read_still: -#endif /* INACCURATE_STILL_TIME */ case READ_STILL_FRAME: { dbg_print(INPUT_DBG_STILL, "Handled still event wait time %u\n", @@ -703,11 +700,11 @@ vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, default: case READ_BLOCK: /* Read buffer */ - buf = fifo->buffer_pool_alloc (fifo); - buf->type = BUF_DEMUX_BLOCK; + p_buf = fifo->buffer_pool_alloc (fifo); + p_buf->type = BUF_DEMUX_BLOCK; } - buf->content = buf->mem; + p_buf->content = p_buf->mem; if (STILL_READING == p_vcdplayer->i_still && 0 == my_vcd.i_old_still) { my_vcd.i_old_deinterlace = xine_get_param(my_vcd.stream, @@ -724,9 +721,9 @@ vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, my_vcd.i_old_still = p_vcdplayer->i_still; /* Ideally this should probably be nlen. */ - memcpy (buf->mem, data, M2F2_SECTOR_SIZE); + memcpy (p_buf->mem, data, M2F2_SECTOR_SIZE); - return buf; + return p_buf; } /*! @@ -1102,8 +1099,7 @@ vcd_handle_events (void) } else { /* PBC is not on. "default" selection beginning of current selection . Alternative: */ - LOG_MSG("%s\n", _("DEFAULT selected but PBC is not on.")); - ; + LOG_MSG("%s\n", _("DEFAULT selected, but PBC is not on.")); } break; case XINE_EVENT_INPUT_NEXT: @@ -1141,7 +1137,6 @@ vcd_handle_events (void) number_addend = 0; if (vcdplayer_pbc_is_on(this)) { - /* version 0.7.21 or greater */ lid_t next_num=vcdinfo_selection_get_lid(this->vcd, this->i_lid, itemid.num); if (VCDINFO_INVALID_LID != next_num) { |