Commit 21d4c7c7 authored by Rocky Bernstein's avatar Rocky Bernstein

A little cleanup on wait timing. No bug fixes yet, though.

parent 39a7f7e6
......@@ -4,7 +4,7 @@
* to go here.
*****************************************************************************
* Copyright (C) 2000,2003 VideoLAN
* $Id: access.c,v 1.8 2003/12/05 04:24:47 rocky Exp $
* $Id: access.c,v 1.9 2003/12/05 05:01:17 rocky Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
* Johan Bilien <jobi@via.ecp.fr>
......@@ -410,7 +410,7 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid )
thread_vcd_data_t * p_vcd= (thread_vcd_data_t *)p_input->p_access_data;
input_area_t * p_area;
p_vcd->in_still = 0;
p_vcd->in_still = false;
dbg_print(INPUT_DBG_CALL, "itemid.num: %d, itemid.type: %d\n",
itemid.num, itemid.type);
......@@ -454,11 +454,11 @@ VCDPlay( input_thread_t *p_input, vcdinfo_itemid_t itemid )
case VCDINFO_FILES_VIDEO_PAL_STILL:
case VCDINFO_FILES_VIDEO_PAL_STILL2:
p_input->stream.b_seekable = 0;
p_vcd->in_still = -5;
p_vcd->in_still = true;
break;
default:
p_input->stream.b_seekable = 1;
p_vcd->in_still = 0;
p_vcd->in_still = false;
}
}
break;
......
......@@ -2,7 +2,7 @@
* intf.c: Video CD interface to handle user interaction and still time
*****************************************************************************
* Copyright (C) 2002,2003 VideoLAN
* $Id: intf.c,v 1.10 2003/12/05 04:24:47 rocky Exp $
* $Id: intf.c,v 1.11 2003/12/05 05:01:17 rocky Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
* from DVD code by Stphane Borel <stef@via.ecp.fr>
......@@ -119,13 +119,13 @@ static void RunIntf( intf_thread_t *p_intf )
vlc_mutex_lock( &p_intf->change_lock );
/*
* still images
* Have we timed-out in showing a still frame?
*/
if( p_intf->p_sys->b_still && !p_intf->p_sys->b_inf_still )
{
if( p_intf->p_sys->m_still_time > 0 )
{
/* update remaining still time */
/* Update remaining still time */
dbg_print(INPUT_DBG_STILL, "updating still time");
mtime = mdate();
if( mlast )
......@@ -137,7 +137,7 @@ static void RunIntf( intf_thread_t *p_intf )
}
else
{
/* still time elasped */
/* Still time has elasped; set to continue playing. */
dbg_print(INPUT_DBG_STILL, "wait time done - setting play");
input_SetStatus( p_intf->p_sys->p_input,
INPUT_STATUS_PLAY );
......@@ -148,7 +148,7 @@ static void RunIntf( intf_thread_t *p_intf )
}
/*
* keyboard event
* Do we have a keyboard event?
*/
if( p_vout && p_intf->p_sys->b_key_pressed )
{
......@@ -227,8 +227,9 @@ static void RunIntf( intf_thread_t *p_intf )
}
number_addend = 0;
/* we can safely interact with the VCD player
* with the stream lock */
/* Any keypress gets rid of still frame waiting.
FIXME - should handle just the ones that cause an action.
*/
if( p_intf->p_sys->b_still )
{
dbg_print(INPUT_DBG_STILL, "Playing still after activate");
......@@ -360,9 +361,9 @@ int vcdIntfStillTime( intf_thread_t *p_intf, int i_sec )
{
vlc_mutex_lock( &p_intf->change_lock );
if( i_sec == 0xff )
if( i_sec == -1 )
{
p_intf->p_sys->b_still = 1;
p_intf->p_sys->b_still = 1;
p_intf->p_sys->b_inf_still = 1;
}
else if( i_sec > 0 )
......
......@@ -2,7 +2,7 @@
* intf.h: send info to intf.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: intf.h,v 1.2 2003/12/05 04:24:47 rocky Exp $
* $Id: intf.h,v 1.3 2003/12/05 05:01:17 rocky Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
......@@ -26,19 +26,20 @@
*****************************************************************************/
struct intf_sys_t
{
input_thread_t * p_input;
thread_vcd_data_t * p_vcd;
vlc_bool_t b_still;
vlc_bool_t b_inf_still;
mtime_t m_still_time;
input_thread_t * p_input;
thread_vcd_data_t * p_vcd;
vlc_bool_t b_still; /* True if we are in a still frame */
vlc_bool_t b_inf_still; /* True if still wait time is infinite */
mtime_t m_still_time; /* Time in microseconds remaining
to wait in still frame.
*/
#if FINISHED
vcdplay_ctrl_t control;
vcdplay_ctrl_t control;
#else
int control;
int control;
#endif
vlc_bool_t b_click, b_move, b_key_pressed;
vlc_bool_t b_click, b_move, b_key_pressed;
};
int vcdIntfStillTime( struct intf_thread_t *, int );
......
......@@ -3,7 +3,7 @@
* using libcdio, libvcd and libvcdinfo
*****************************************************************************
* Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
* $Id: vcdplayer.c,v 1.6 2003/12/05 04:24:47 rocky Exp $
* $Id: vcdplayer.c,v 1.7 2003/12/05 05:01:17 rocky Exp $
*
* 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
......@@ -136,9 +136,6 @@ vcdplayer_non_pbc_nav ( input_thread_t * p_input )
return READ_BLOCK;
}
/* FIXME: Will do whatever the right thing is later. */
#define SLEEP_1_SEC_AND_HANDLE_EVENTS sleep(1)
/* Handles PBC navigation when reaching the end of a play item. */
vcdplayer_read_status_t
vcdplayer_pbc_nav ( input_thread_t * p_input )
......@@ -148,12 +145,6 @@ vcdplayer_pbc_nav ( input_thread_t * p_input )
/* We are in playback control. */
vcdinfo_itemid_t itemid;
if (0 != p_vcd->in_still && p_vcd->in_still != -5) {
SLEEP_1_SEC_AND_HANDLE_EVENTS;
if (p_vcd->in_still > 0) p_vcd->in_still--;
return READ_STILL_FRAME;
}
/* The end of an entry is really the end of the associated
sequence (or track). */
......@@ -181,18 +172,11 @@ vcdplayer_pbc_nav ( input_thread_t * p_input )
return READ_BLOCK;
/* Handle any wait time given. */
if (-5 == p_vcd->in_still) {
if (wait_time != 0) {
/* FIXME */
p_vcd->in_still = wait_time - 1;
p_vcd->p_intf->p_sys->m_still_time = (wait_time - 1) * 1000000;
return READ_STILL_FRAME;
} else {
p_vcd->p_intf->p_sys->m_still_time = 0;
p_vcd->p_intf->p_sys->b_inf_still = 1;
}
if (p_vcd->in_still) {
vcdIntfStillTime( p_vcd->p_intf, wait_time );
return READ_STILL_FRAME;
}
vcdplayer_update_entry( p_input,
vcdinf_pld_get_next_offset(p_vcd->pxd.pld),
&itemid.num, "next" );
......@@ -213,18 +197,10 @@ vcdplayer_pbc_nav ( input_thread_t * p_input )
wait_time, p_vcd->loop_count, max_loop);
/* Handle any wait time given */
if (-5 == p_vcd->in_still) {
if (wait_time != 0) {
/* FIXME */
p_vcd->in_still = wait_time - 1;
p_vcd->p_intf->p_sys->m_still_time = (wait_time - 1) * 1000000;
return READ_STILL_FRAME;
} else {
p_vcd->p_intf->p_sys->m_still_time = 0;
p_vcd->p_intf->p_sys->b_inf_still = 1;
}
if (p_vcd->in_still) {
vcdIntfStillTime( p_vcd->p_intf, wait_time );
return READ_STILL_FRAME;
}
}
/* Handle any looping given. */
if ( max_loop == 0 || p_vcd->loop_count < max_loop ) {
......@@ -263,7 +239,7 @@ vcdplayer_pbc_nav ( input_thread_t * p_input )
return READ_BLOCK;
} else if (p_vcd->in_still) {
/* Hack: Just go back and do still again */
SLEEP_1_SEC_AND_HANDLE_EVENTS ;
sleep(1);
return READ_STILL_FRAME;
}
}
......
/*****************************************************************************
* Copyright (C) 2003 Rocky Bernstein (for VideoLAN)
* $Id: vcdplayer.h,v 1.3 2003/12/04 05:14:39 rocky Exp $
* $Id: vcdplayer.h,v 1.4 2003/12/05 05:01:17 rocky Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
*
......@@ -65,12 +65,7 @@ typedef enum {
typedef struct thread_vcd_data_s
{
vcdinfo_obj_t *vcd; /* CD device descriptor */
int in_still; /* 0 if not in still,
-2 if in infinite loop
-5 if a still but haven't
read wait time yet
>0 number of seconds yet to
wait */
bool in_still; /* true if in still */
unsigned int num_tracks; /* Nb of tracks (titles) */
unsigned int num_segments; /* Nb of segments */
unsigned int num_entries; /* Nb of entries */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment