Changeset 21d4c7c7e8743d9849cfcd338496d3a613ab39fa
- Timestamp:
- 12/05/03 06:01:17
(5 years ago)
- Author:
- Rocky Bernstein <rocky@videolan.org>
- git-committer:
- Rocky Bernstein <rocky@videolan.org> 1070600477 +0000
- git-parent:
[39a7f7e696685c58885539226344c9c93e24fce5]
- git-author:
- Rocky Bernstein <rocky@videolan.org> 1070600477 +0000
- Message:
A little cleanup on wait timing. No bug fixes yet, though.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r39a7f7e |
r21d4c7c |
|
| 5 | 5 | ***************************************************************************** |
|---|
| 6 | 6 | * Copyright (C) 2000,2003 VideoLAN |
|---|
| 7 | | * $Id: access.c,v 1.8 2003/12/05 04:24:47 rocky Exp $ |
|---|
| | 7 | * $Id: access.c,v 1.9 2003/12/05 05:01:17 rocky Exp $ |
|---|
| 8 | 8 | * |
|---|
| 9 | 9 | * Authors: Rocky Bernstein <rocky@panix.com> |
|---|
| … | … | |
| 411 | 411 | input_area_t * p_area; |
|---|
| 412 | 412 | |
|---|
| 413 | | p_vcd->in_still = 0; |
|---|
| | 413 | p_vcd->in_still = false; |
|---|
| 414 | 414 | |
|---|
| 415 | 415 | dbg_print(INPUT_DBG_CALL, "itemid.num: %d, itemid.type: %d\n", |
|---|
| … | … | |
| 455 | 455 | case VCDINFO_FILES_VIDEO_PAL_STILL2: |
|---|
| 456 | 456 | p_input->stream.b_seekable = 0; |
|---|
| 457 | | p_vcd->in_still = -5; |
|---|
| | 457 | p_vcd->in_still = true; |
|---|
| 458 | 458 | break; |
|---|
| 459 | 459 | default: |
|---|
| 460 | 460 | p_input->stream.b_seekable = 1; |
|---|
| 461 | | p_vcd->in_still = 0; |
|---|
| | 461 | p_vcd->in_still = false; |
|---|
| 462 | 462 | } |
|---|
| 463 | 463 | } |
|---|
| r39a7f7e |
r21d4c7c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2002,2003 VideoLAN |
|---|
| 5 | | * $Id: intf.c,v 1.10 2003/12/05 04:24:47 rocky Exp $ |
|---|
| | 5 | * $Id: intf.c,v 1.11 2003/12/05 05:01:17 rocky Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Rocky Bernstein <rocky@panix.com> |
|---|
| … | … | |
| 120 | 120 | |
|---|
| 121 | 121 | /* |
|---|
| 122 | | * still images |
|---|
| | 122 | * Have we timed-out in showing a still frame? |
|---|
| 123 | 123 | */ |
|---|
| 124 | 124 | if( p_intf->p_sys->b_still && !p_intf->p_sys->b_inf_still ) |
|---|
| … | … | |
| 126 | 126 | if( p_intf->p_sys->m_still_time > 0 ) |
|---|
| 127 | 127 | { |
|---|
| 128 | | /* update remaining still time */ |
|---|
| | 128 | /* Update remaining still time */ |
|---|
| 129 | 129 | dbg_print(INPUT_DBG_STILL, "updating still time"); |
|---|
| 130 | 130 | mtime = mdate(); |
|---|
| … | … | |
| 138 | 138 | else |
|---|
| 139 | 139 | { |
|---|
| 140 | | /* still time elasped */ |
|---|
| | 140 | /* Still time has elasped; set to continue playing. */ |
|---|
| 141 | 141 | dbg_print(INPUT_DBG_STILL, "wait time done - setting play"); |
|---|
| 142 | 142 | input_SetStatus( p_intf->p_sys->p_input, |
|---|
| … | … | |
| 149 | 149 | |
|---|
| 150 | 150 | /* |
|---|
| 151 | | * keyboard event |
|---|
| | 151 | * Do we have a keyboard event? |
|---|
| 152 | 152 | */ |
|---|
| 153 | 153 | if( p_vout && p_intf->p_sys->b_key_pressed ) |
|---|
| … | … | |
| 228 | 228 | number_addend = 0; |
|---|
| 229 | 229 | |
|---|
| 230 | | /* we can safely interact with the VCD player |
|---|
| 231 | | * with the stream lock */ |
|---|
| | 230 | /* Any keypress gets rid of still frame waiting. |
|---|
| | 231 | FIXME - should handle just the ones that cause an action. |
|---|
| | 232 | */ |
|---|
| 232 | 233 | if( p_intf->p_sys->b_still ) |
|---|
| 233 | 234 | { |
|---|
| … | … | |
| 361 | 362 | vlc_mutex_lock( &p_intf->change_lock ); |
|---|
| 362 | 363 | |
|---|
| 363 | | if( i_sec == 0xff ) |
|---|
| 364 | | { |
|---|
| 365 | | p_intf->p_sys->b_still = 1; |
|---|
| | 364 | if( i_sec == -1 ) |
|---|
| | 365 | { |
|---|
| | 366 | p_intf->p_sys->b_still = 1; |
|---|
| 366 | 367 | p_intf->p_sys->b_inf_still = 1; |
|---|
| 367 | 368 | } |
|---|
| r39a7f7e |
r21d4c7c |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: intf.h,v 1.2 2003/12/05 04:24:47 rocky Exp $ |
|---|
| | 5 | * $Id: intf.h,v 1.3 2003/12/05 05:01:17 rocky Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Author: St�ane Borel <stef@via.ecp.fr> |
|---|
| … | … | |
| 27 | 27 | struct intf_sys_t |
|---|
| 28 | 28 | { |
|---|
| 29 | | input_thread_t * p_input; |
|---|
| 30 | | thread_vcd_data_t * p_vcd; |
|---|
| 31 | | |
|---|
| 32 | | vlc_bool_t b_still; |
|---|
| 33 | | vlc_bool_t b_inf_still; |
|---|
| 34 | | mtime_t m_still_time; |
|---|
| 35 | | |
|---|
| | 29 | input_thread_t * p_input; |
|---|
| | 30 | thread_vcd_data_t * p_vcd; |
|---|
| | 31 | |
|---|
| | 32 | vlc_bool_t b_still; /* True if we are in a still frame */ |
|---|
| | 33 | vlc_bool_t b_inf_still; /* True if still wait time is infinite */ |
|---|
| | 34 | mtime_t m_still_time; /* Time in microseconds remaining |
|---|
| | 35 | to wait in still frame. |
|---|
| | 36 | */ |
|---|
| 36 | 37 | #if FINISHED |
|---|
| 37 | | vcdplay_ctrl_t control; |
|---|
| | 38 | vcdplay_ctrl_t control; |
|---|
| 38 | 39 | #else |
|---|
| 39 | | int control; |
|---|
| | 40 | int control; |
|---|
| 40 | 41 | #endif |
|---|
| 41 | | vlc_bool_t b_click, b_move, b_key_pressed; |
|---|
| | 42 | vlc_bool_t b_click, b_move, b_key_pressed; |
|---|
| 42 | 43 | }; |
|---|
| 43 | 44 | |
|---|
| r39a7f7e |
r21d4c7c |
|
| 4 | 4 | ***************************************************************************** |
|---|
| 5 | 5 | * Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> |
|---|
| 6 | | * $Id: vcdplayer.c,v 1.6 2003/12/05 04:24:47 rocky Exp $ |
|---|
| | 6 | * $Id: vcdplayer.c,v 1.7 2003/12/05 05:01:17 rocky Exp $ |
|---|
| 7 | 7 | * |
|---|
| 8 | 8 | * This program is free software; you can redistribute it and/or modify |
|---|
| … | … | |
| 137 | 137 | } |
|---|
| 138 | 138 | |
|---|
| 139 | | /* FIXME: Will do whatever the right thing is later. */ |
|---|
| 140 | | #define SLEEP_1_SEC_AND_HANDLE_EVENTS sleep(1) |
|---|
| 141 | | |
|---|
| 142 | 139 | /* Handles PBC navigation when reaching the end of a play item. */ |
|---|
| 143 | 140 | vcdplayer_read_status_t |
|---|
| … | … | |
| 148 | 145 | /* We are in playback control. */ |
|---|
| 149 | 146 | vcdinfo_itemid_t itemid; |
|---|
| 150 | | |
|---|
| 151 | | if (0 != p_vcd->in_still && p_vcd->in_still != -5) { |
|---|
| 152 | | SLEEP_1_SEC_AND_HANDLE_EVENTS; |
|---|
| 153 | | if (p_vcd->in_still > 0) p_vcd->in_still--; |
|---|
| 154 | | return READ_STILL_FRAME; |
|---|
| 155 | | } |
|---|
| 156 | 147 | |
|---|
| 157 | 148 | /* The end of an entry is really the end of the associated |
|---|
| … | … | |
| 182 | 173 | |
|---|
| 183 | 174 | /* Handle any wait time given. */ |
|---|
| 184 | | if (-5 == p_vcd->in_still) { |
|---|
| 185 | | if (wait_time != 0) { |
|---|
| 186 | | /* FIXME */ |
|---|
| 187 | | p_vcd->in_still = wait_time - 1; |
|---|
| 188 | | p_vcd->p_intf->p_sys->m_still_time = (wait_time - 1) * 1000000; |
|---|
| 189 | | return READ_STILL_FRAME; |
|---|
| 190 | | } else { |
|---|
| 191 | | p_vcd->p_intf->p_sys->m_still_time = 0; |
|---|
| 192 | | p_vcd->p_intf->p_sys->b_inf_still = 1; |
|---|
| 193 | | } |
|---|
| 194 | | |
|---|
| 195 | | } |
|---|
| | 175 | if (p_vcd->in_still) { |
|---|
| | 176 | vcdIntfStillTime( p_vcd->p_intf, wait_time ); |
|---|
| | 177 | return READ_STILL_FRAME; |
|---|
| | 178 | } |
|---|
| | 179 | |
|---|
| 196 | 180 | vcdplayer_update_entry( p_input, |
|---|
| 197 | 181 | vcdinf_pld_get_next_offset(p_vcd->pxd.pld), |
|---|
| … | … | |
| 214 | 198 | |
|---|
| 215 | 199 | /* Handle any wait time given */ |
|---|
| 216 | | if (-5 == p_vcd->in_still) { |
|---|
| 217 | | if (wait_time != 0) { |
|---|
| 218 | | /* FIXME */ |
|---|
| 219 | | p_vcd->in_still = wait_time - 1; |
|---|
| 220 | | p_vcd->p_intf->p_sys->m_still_time = (wait_time - 1) * 1000000; |
|---|
| 221 | | return READ_STILL_FRAME; |
|---|
| 222 | | } else { |
|---|
| 223 | | p_vcd->p_intf->p_sys->m_still_time = 0; |
|---|
| 224 | | p_vcd->p_intf->p_sys->b_inf_still = 1; |
|---|
| 225 | | } |
|---|
| | 200 | if (p_vcd->in_still) { |
|---|
| | 201 | vcdIntfStillTime( p_vcd->p_intf, wait_time ); |
|---|
| 226 | 202 | return READ_STILL_FRAME; |
|---|
| 227 | | } |
|---|
| | 203 | } |
|---|
| 228 | 204 | |
|---|
| 229 | 205 | /* Handle any looping given. */ |
|---|
| … | … | |
| 264 | 240 | } else if (p_vcd->in_still) { |
|---|
| 265 | 241 | /* Hack: Just go back and do still again */ |
|---|
| 266 | | SLEEP_1_SEC_AND_HANDLE_EVENTS ; |
|---|
| | 242 | sleep(1); |
|---|
| 267 | 243 | return READ_STILL_FRAME; |
|---|
| 268 | 244 | } |
|---|
| r5383df0 |
r21d4c7c |
|
| 1 | 1 | /***************************************************************************** |
|---|
| 2 | 2 | * Copyright (C) 2003 Rocky Bernstein (for VideoLAN) |
|---|
| 3 | | * $Id: vcdplayer.h,v 1.3 2003/12/04 05:14:39 rocky Exp $ |
|---|
| | 3 | * $Id: vcdplayer.h,v 1.4 2003/12/05 05:01:17 rocky Exp $ |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * Authors: Rocky Bernstein <rocky@panix.com> |
|---|
| … | … | |
| 66 | 66 | { |
|---|
| 67 | 67 | vcdinfo_obj_t *vcd; /* CD device descriptor */ |
|---|
| 68 | | int in_still; /* 0 if not in still, |
|---|
| 69 | | -2 if in infinite loop |
|---|
| 70 | | -5 if a still but haven't |
|---|
| 71 | | read wait time yet |
|---|
| 72 | | >0 number of seconds yet to |
|---|
| 73 | | wait */ |
|---|
| | 68 | bool in_still; /* true if in still */ |
|---|
| 74 | 69 | unsigned int num_tracks; /* Nb of tracks (titles) */ |
|---|
| 75 | 70 | unsigned int num_segments; /* Nb of segments */ |
|---|