Changeset 2aebce79d5f564b25de506071c2de578315cb14a
- Timestamp:
- 23/06/04 19:49:26 (4 years ago)
- git-parent:
- Files:
-
- include/vlc_input.h (modified) (2 diffs)
- modules/control/hotkeys.c (modified) (1 diff)
- modules/demux/util/sub.c (modified) (5 diffs)
- modules/demux/util/sub.h (modified) (1 diff)
- src/input/control.c (modified) (12 diffs)
- src/input/es_out.c (modified) (5 diffs)
- src/input/input.c (modified) (5 diffs)
- src/input/input_internal.h (modified) (2 diffs)
- src/input/var.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_input.h
r7d01a7e r2aebce7 312 312 INPUT_SET_STATE, /* arg1= int res=can fail */ 313 313 314 /* input variable "audio-delay" and "spu-delay" */ 315 INPUT_GET_AUDIO_DELAY, /* arg1 = int* res=can fail */ 316 INPUT_SET_AUDIO_DELAY, /* arg1 = int res=can fail */ 317 INPUT_GET_SPU_DELAY, /* arg1 = int* res=can fail */ 318 INPUT_SET_SPU_DELAY, /* arg1 = int res=can fail */ 319 320 /* Meta datas */ 321 INPUT_ADD_INFO, /* arg1= char * arg2= char * arg3=... res=can fail */ 322 INPUT_GET_INFO, /* arg1= char * arg2= char * arg3= char ** res=can fail*/ 323 324 INPUT_SET_NAME, /* arg1= char * res=can fail */ 325 314 326 /* XXX: all next query aren't working for now */ 315 316 327 /* bookmarks */ 317 328 INPUT_GET_BOOKMARKS, /* arg1= seekpoint_t *** arg2= int * res=can fail */ … … 321 332 INPUT_DEL_BOOKMARK, /* arg1= seekpoint_t * res=can fail */ 322 333 INPUT_SET_BOOKMARK, /* arg1= int res=can fail */ 323 324 INPUT_ADD_OPTION, /* arg1= char * arg2= char * res=can fail */325 326 /* */327 INPUT_ADD_INFO, /* arg1= char * arg2= char * arg3=... res=can fail */328 INPUT_GET_INFO, /* arg1= char * arg2= char * arg3= char ** res=can fail*/329 330 INPUT_SET_NAME, /* arg1= char * res=can fail */331 332 /* */333 INPUT_GET_SUBDELAY, /* arg1 = int* res=can fail */334 INPUT_SET_SUBDELAY, /* arg1 = int res=can fail */335 334 }; 336 335 modules/control/hotkeys.c
r1b834a3 r2aebce7 292 292 else if( i_action == ACTIONID_SUBDELAY_DOWN ) 293 293 { 294 int i_delay; 295 if( input_Control( p_input, INPUT_GET_SUBDELAY, &i_delay ) == 296 VLC_SUCCESS ) 297 { 298 i_delay--; 299 input_Control( p_input, INPUT_SET_SUBDELAY, i_delay ); 300 ClearChannels( p_intf, p_vout ); 301 vout_OSDMessage( p_intf, DEFAULT_CHAN, "Subtitle delay %i ms", 302 i_delay*100); 303 } 294 int64_t i_delay = var_GetTime( p_input, "spu-delay" ); 295 296 i_delay -= 10000; /* 10 ms */ 297 298 var_SetTime( p_input, "spu-delay", i_delay ); 299 ClearChannels( p_intf, p_vout ); 300 vout_OSDMessage( p_intf, DEFAULT_CHAN, "Subtitle delay %i ms", 301 (int)(i_delay/1000) ); 304 302 } 305 303 else if( i_action == ACTIONID_SUBDELAY_UP ) 306 304 { 307 int i_delay; 308 if( input_Control( p_input, INPUT_GET_SUBDELAY, &i_delay ) == 309 VLC_SUCCESS ) 310 { 311 i_delay++; 312 input_Control( p_input, INPUT_SET_SUBDELAY, i_delay ); 313 ClearChannels( p_intf, p_vout ); 314 vout_OSDMessage( p_intf, DEFAULT_CHAN, "Subtitle delay %i ms", 315 i_delay*100); 316 } 305 int64_t i_delay = var_GetTime( p_input, "spu-delay" ); 306 307 i_delay += 10000; /* 10 ms */ 308 309 var_SetTime( p_input, "spu-delay", i_delay ); 310 ClearChannels( p_intf, p_vout ); 311 vout_OSDMessage( p_intf, DEFAULT_CHAN, "Subtitle delay %i ms", 312 (int)(i_delay/1000) ); 317 313 } 318 314 else if( i_action == ACTIONID_FULLSCREEN && p_vout ) modules/demux/util/sub.c
re444b4f r2aebce7 77 77 N_("Frames per second"), 78 78 SUB_FPS_LONGTEXT, VLC_TRUE ); 79 add_integer( "sub-delay", 0, NULL,80 N_("Delay subtitles (in 1/10s)"),81 SUB_DELAY_LONGTEXT, VLC_TRUE );82 79 add_string( "sub-type", "auto", NULL, "Subtitles fileformat", 83 80 SUB_TYPE_LONGTEXT, VLC_TRUE ); … … 491 488 vlc_bool_t b; 492 489 vlc_value_t val; 493 mtime_t i_delay;494 490 495 491 es_out_Control( p_input->p_es_out, ES_OUT_GET_ES_STATE, p_sub->p_es, &b ); … … 508 504 if( p_sub->i_sub_type != SUB_TYPE_VOBSUB ) 509 505 { 510 var_Get( p_sub, "sub-delay", &val );511 i_delay = (mtime_t) val.i_int * 100000;512 506 while( p_sub->i_subtitle < p_sub->i_subtitles && 513 p_sub->subtitle[p_sub->i_subtitle].i_start < i_maxdate - i_delay)507 p_sub->subtitle[p_sub->i_subtitle].i_start < i_maxdate ) 514 508 { 515 509 block_t *p_block; … … 527 521 p_sub->i_subtitle++; 528 522 continue; 529 }530 531 /* XXX we should convert all demuxers to use es_out_Control to set * pcr and then remove that */532 if( i_delay != 0 )533 {534 p_sub->subtitle[p_sub->i_subtitle].i_start += i_delay;535 p_sub->subtitle[p_sub->i_subtitle].i_stop += i_delay;536 523 } 537 524 … … 687 674 } 688 675 } while( !i_done ); 689 #if 0690 /* We do not do this here anymore */691 /* *** and at the end add delay *** */692 var_Get( p_sub, "sub-delay", &val );693 i_delay = (mtime_t) val.i_int * 100000;694 if( i_delay != 0 )695 {696 for( i = 0; i < p_sub->i_subtitles; i++ )697 {698 p_sub->subtitle[i].i_start += i_delay;699 p_sub->subtitle[i].i_stop += i_delay;700 if( p_sub->subtitle[i].i_start < 0 )701 {702 p_sub->i_subtitle = i + 1;703 }704 }705 }706 #endif707 676 } 708 677 modules/demux/util/sub.h
rd6f72ea r2aebce7 82 82 * - i_microsecperframe is used only for microdvd file. (overriden 83 83 * by --sub-fps ) 84 * - it's at this point that --sub-delay is applied85 84 * 86 85 *****************************************************************************/ src/input/control.c
r68d2178 r2aebce7 31 31 32 32 static void UpdateBookmarksOption( input_thread_t * ); 33 static void NotifyPlaylist( input_thread_t * ); 33 34 34 35 /**************************************************************************** … … 55 56 int input_vaControl( input_thread_t *p_input, int i_query, va_list args ) 56 57 { 57 seekpoint_t *p_bkmk, ***ppp_bkmk;58 /* seekpoint_t *p_bkmk, ***ppp_bkmk; 58 59 int i_bkmk = 0; 59 60 int *pi_bkmk; 60 int i, *pi; 61 vlc_value_t val, text; 62 char *psz_option, *psz_value; 61 */ 63 62 int i_int, *pi_int; 64 63 double f, *pf; … … 108 107 return var_SetInteger( p_input, "state", i_int ); 109 108 110 #if 0 111 case INPUT_ADD_OPTION: 112 { 113 psz_option = (char *)va_arg( args, char * ); 114 psz_value = (char *)va_arg( args, char * ); 115 i_ret = VLC_EGENERIC; 116 117 vlc_mutex_lock( &p_input->p_item->lock ); 118 /* Check if option already exists */ 119 for( i = 0; i < p_input->p_item->i_options; i++ ) 120 { 121 if( !strncmp( p_input->p_item->ppsz_options[i], psz_option, 122 strlen( psz_option ) ) && 123 p_input->p_item->ppsz_options[i][strlen(psz_option)] 124 == '=' ) 125 { 126 free( p_input->p_item->ppsz_options[i] ); 127 break; 128 } 129 } 130 if( i == p_input->p_item->i_options ) 131 { 132 p_input->p_item->i_options++; 133 p_input->p_item->ppsz_options = 134 realloc( p_input->p_item->ppsz_options, 135 p_input->p_item->i_options * sizeof(char **) ); 136 } 137 138 asprintf( &p_input->p_item->ppsz_options[i], 139 "%s=%s", psz_option, psz_value ) ; 140 vlc_mutex_unlock( &p_input->p_item->lock ); 141 142 i_ret = VLC_SUCCESS; 143 break; 144 } 145 146 case INPUT_SET_NAME: 147 { 148 char *psz_name = (char *)va_arg( args, char * ); 149 i_ret = VLC_EGENERIC; 150 if( !psz_name ) break; 151 vlc_mutex_lock( &p_input->p_item->lock ); 152 if( p_input->p_item->psz_name ) free( p_input->p_item->psz_name ); 153 p_input->p_item->psz_name = strdup( psz_name ); 154 vlc_mutex_unlock( &p_input->p_item->lock ); 155 i_ret = VLC_SUCCESS; 156 157 /* Notify playlist */ 158 { 159 vlc_value_t val; 160 playlist_t *p_playlist = 161 (playlist_t *)vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, 162 FIND_PARENT ); 163 if( p_playlist ) 164 { 165 val.i_int = p_playlist->i_index; 166 vlc_mutex_unlock( &p_input->stream.stream_lock ); 167 var_Set( p_playlist, "item-change", val ); 168 vlc_mutex_lock( &p_input->stream.stream_lock ); 169 vlc_object_release( p_playlist ); 170 } 171 } 172 break; 173 } 109 case INPUT_GET_AUDIO_DELAY: 110 pi_64 = (int64_t*)va_arg( args, int64_t * ); 111 *pi_64 = var_GetTime( p_input, "audio-delay" ); 112 return VLC_SUCCESS; 113 114 case INPUT_GET_SPU_DELAY: 115 pi_64 = (int64_t*)va_arg( args, int64_t * ); 116 *pi_64 = var_GetTime( p_input, "spu-delay" ); 117 return VLC_SUCCESS; 118 119 case INPUT_SET_AUDIO_DELAY: 120 i_64 = (int64_t)va_arg( args, int64_t ); 121 return var_SetTime( p_input, "audio-delay", i_64 ); 122 123 case INPUT_SET_SPU_DELAY: 124 i_64 = (int64_t)va_arg( args, int64_t ); 125 return var_SetTime( p_input, "spu-delay", i_64 ); 174 126 175 127 case INPUT_ADD_INFO: … … 183 135 int i; 184 136 185 i_ret = VLC_EGENERIC; 186 187 vlc_mutex_lock( &p_input->p_item->lock ); 188 for( i = 0; i < p_input->p_item->i_categories; i++ ) 189 { 190 if( !strcmp( p_input->p_item->pp_categories[i]->psz_name, 137 vlc_mutex_lock( &p_input->input.p_item->lock ); 138 for( i = 0; i < p_input->input.p_item->i_categories; i++ ) 139 { 140 if( !strcmp( p_input->input.p_item->pp_categories[i]->psz_name, 191 141 psz_cat ) ) 192 break;193 } 194 195 if( i == p_input-> p_item->i_categories )142 return VLC_EGENERIC; 143 } 144 145 if( i == p_input->input.p_item->i_categories ) 196 146 { 197 147 p_cat = malloc( sizeof( info_category_t ) ); 198 if( !p_cat ) break; 148 if( !p_cat ) 149 return VLC_EGENERIC; 199 150 p_cat->psz_name = strdup( psz_cat ); 200 151 p_cat->i_infos = 0; 201 152 p_cat->pp_infos = NULL; 202 INSERT_ELEM( p_input-> p_item->pp_categories,203 p_input-> p_item->i_categories,204 p_input-> p_item->i_categories, p_cat );205 } 206 207 p_cat = p_input-> p_item->pp_categories[i];153 INSERT_ELEM( p_input->input.p_item->pp_categories, 154 p_input->input.p_item->i_categories, 155 p_input->input.p_item->i_categories, p_cat ); 156 } 157 158 p_cat = p_input->input.p_item->pp_categories[i]; 208 159 209 160 for( i = 0; i < p_cat->i_infos; i++ ) … … 213 164 if( p_cat->pp_infos[i]->psz_value ) 214 165 free( p_cat->pp_infos[i]->psz_value ); 215 break;166 return VLC_EGENERIC; 216 167 } 217 168 } … … 220 171 { 221 172 p_info = malloc( sizeof( info_t ) ); 222 if( !p_info ) break; 173 if( !p_info ) 174 return VLC_EGENERIC; 223 175 INSERT_ELEM( p_cat->pp_infos, p_cat->i_infos, 224 176 p_cat->i_infos, p_info ); … … 229 181 vasprintf( &p_info->psz_value, psz_format, args ); 230 182 231 vlc_mutex_unlock( &p_input->p_item->lock ); 232 233 i_ret = VLC_SUCCESS; 234 235 /* Notify playlist */ 236 { 237 vlc_value_t val; 238 playlist_t *p_playlist = 239 (playlist_t *)vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, 240 FIND_PARENT ); 241 if( p_playlist ) 242 { 243 val.i_int = p_playlist->i_index; 244 vlc_mutex_unlock( &p_input->stream.stream_lock ); 245 var_Set( p_playlist, "item-change", val ); 246 vlc_mutex_lock( &p_input->stream.stream_lock ); 247 vlc_object_release( p_playlist ); 248 } 249 } 183 vlc_mutex_unlock( &p_input->input.p_item->lock ); 184 185 NotifyPlaylist( p_input ); 250 186 } 251 break;187 return VLC_SUCCESS; 252 188 253 189 case INPUT_GET_INFO: … … 256 192 char *psz_name = (char *)va_arg( args, char * ); 257 193 char **ppsz_value = (char **)va_arg( args, char ** ); 194 int i_ret = VLC_EGENERIC; 258 195 int i; 259 260 i_ret = VLC_EGENERIC;261 196 *ppsz_value = NULL; 262 197 263 vlc_mutex_lock( &p_input-> p_item->lock );264 for( i = 0; i < p_input-> p_item->i_categories; i++ )265 { 266 if( !strcmp( p_input-> p_item->pp_categories[i]->psz_name,198 vlc_mutex_lock( &p_input->input.p_item->lock ); 199 for( i = 0; i < p_input->input.p_item->i_categories; i++ ) 200 { 201 if( !strcmp( p_input->input.p_item->pp_categories[i]->psz_name, 267 202 psz_cat ) ) 268 break;269 } 270 271 if( i != p_input-> p_item->i_categories )203 return VLC_EGENERIC; 204 } 205 206 if( i != p_input->input.p_item->i_categories ) 272 207 { 273 208 info_category_t *p_cat; 274 p_cat = p_input-> p_item->pp_categories[i];209 p_cat = p_input->input.p_item->pp_categories[i]; 275 210 276 211 for( i = 0; i < p_cat->i_infos; i++ ) … … 287 222 } 288 223 } 289 vlc_mutex_unlock( &p_input->p_item->lock ); 224 vlc_mutex_unlock( &p_input->input.p_item->lock ); 225 return i_ret; 290 226 } 291 break; 292 227 228 case INPUT_SET_NAME: 229 { 230 char *psz_name = (char *)va_arg( args, char * ); 231 232 if( !psz_name ) 233 return VLC_EGENERIC; 234 235 vlc_mutex_lock( &p_input->input.p_item->lock ); 236 if( p_input->input.p_item->psz_name ) 237 free( p_input->input.p_item->psz_name ); 238 p_input->input.p_item->psz_name = strdup( psz_name ); 239 vlc_mutex_unlock( &p_input->input.p_item->lock ); 240 241 NotifyPlaylist( p_input ); 242 243 return VLC_SUCCESS; 244 } 245 246 #if 0 293 247 case INPUT_ADD_BOOKMARK: 294 248 p_bkmk = (seekpoint_t *)va_arg( args, seekpoint_t * ); … … 441 395 break; 442 396 443 case INPUT_GET_SUBDELAY:444 pi = (int*)va_arg( args, int *);445 /* We work on the first subtitle */446 if( p_input->p_sys != NULL )447 {448 if( p_input->p_sys->i_sub > 0 )449 {450 i_ret = var_Get( (vlc_object_t *)p_input->p_sys->sub[0],451 "sub-delay", &val );452 *pi = val.i_int;453 }454 else455 {456 msg_Dbg( p_input,"no subtitle track");457 i_ret = VLC_EGENERIC;458 }459 }460 else461 {462 i_ret = VLC_EGENERIC;463 }464 break;465 466 case INPUT_SET_SUBDELAY:467 i = (int)va_arg( args, int );468 /* We work on the first subtitle */469 if( p_input->p_sys )470 {471 if( p_input->p_sys->i_sub > 0 )472 {473 val.i_int = i;474 i_ret = var_Set( (vlc_object_t *)p_input->p_sys->sub[0],475 "sub-delay", val );476 }477 else478 {479 msg_Dbg( p_input,"no subtitle track");480 i_ret = VLC_EGENERIC;481 }482 }483 else484 {485 i_ret = VLC_EGENERIC;486 }487 break;488 397 #endif 489 398 case INPUT_GET_BOOKMARKS: … … 493 402 case INPUT_DEL_BOOKMARK: 494 403 case INPUT_SET_BOOKMARK: 495 case INPUT_ADD_OPTION:496 case INPUT_ADD_INFO:497 case INPUT_GET_INFO:498 case INPUT_SET_NAME:499 case INPUT_GET_SUBDELAY:500 case INPUT_SET_SUBDELAY:501 404 /* FIXME */ 502 405 msg_Err( p_input, "unimplemented query in input_vaControl" ); … … 507 410 } 508 411 412 static void NotifyPlaylist( input_thread_t *p_input ) 413 { 414 playlist_t *p_playlist = 415 (playlist_t *)vlc_object_find( p_input, VLC_OBJECT_PLAYLIST, 416 FIND_PARENT ); 417 if( p_playlist ) 418 { 419 var_SetInteger( p_playlist, "item-change", p_playlist->i_index ); 420 vlc_object_release( p_playlist ); 421 } 422 } 423 509 424 static void UpdateBookmarksOption( input_thread_t *p_input ) 510 425 { 426 #if 0 511 427 int i, i_len = 0; 512 428 char *psz_value = NULL, *psz_next = NULL; 513 429 /* FIXME */ 514 #if 0515 430 vlc_mutex_unlock( &p_input->stream.stream_lock ); 516 431 src/input/es_out.c
r68d2178 r2aebce7 98 98 es_out_id_t *p_es_video; 99 99 es_out_id_t *p_es_sub; 100 101 /* delay */ 102 int64_t i_audio_delay; 103 int64_t i_spu_delay; 100 104 }; 101 105 … … 154 158 p_sys->p_es_sub = NULL; 155 159 160 p_sys->i_audio_delay= 0; 161 p_sys->i_spu_delay = 0; 162 156 163 return out; 157 164 } … … 224 231 } 225 232 } 233 } 234 235 void input_EsOutSetDelay( es_out_t *out, int i_cat, int64_t i_delay ) 236 { 237 es_out_sys_t *p_sys = out->p_sys; 238 239 if( i_cat == AUDIO_ES ) 240 p_sys->i_audio_delay = i_delay; 241 else if( i_cat == SPU_ES ) 242 p_sys->i_spu_delay = i_delay; 226 243 } 227 244 … … 716 733 input_thread_t *p_input = p_sys->p_input; 717 734 es_out_pgrm_t *p_pgrm = es->p_pgrm; 735 int64_t i_delay; 736 737 if( es->fmt.i_cat == AUDIO_ES ) 738 i_delay = p_sys->i_audio_delay; 739 else if( es->fmt.i_cat == SPU_ES ) 740 i_delay = p_sys->i_spu_delay; 741 else 742 i_delay = 0; 718 743 719 744 /* +11 -> avoid null value with non null dts/pts */ … … 721 746 { 722 747 p_block->i_dts = 723 input_ClockGetTS( p_input, &p_pgrm->clock, ( p_block->i_dts + 11 ) * 9 / 100 ); 748 input_ClockGetTS( p_input, &p_pgrm->clock, 749 ( p_block->i_dts + 11 ) * 9 / 100 ) + i_delay; 724 750 } 725 751 if( p_block->i_pts > 0 ) 726 752 { 727 753 p_block->i_pts = 728 input_ClockGetTS( p_input, &p_pgrm->clock, ( p_block->i_pts + 11 )* 9 / 100 ); 754 input_ClockGetTS( p_input, &p_pgrm->clock, 755 ( p_block->i_pts + 11 ) * 9 / 100 ) + i_delay; 729 756 } 730 757 src/input/input.c
reb3c709 r2aebce7 76 76 * - chapter,chapter-next, chapter-prev 77 77 * - program, audio-es, video-es, spu-es 78 * - audio-delay, spu-delay 78 79 * - bookmark 79 80 * * Get only: 80 81 * - length 81 82 * - bookmarks 83 * - seekable (if you can seek, it doesn't say if 'bar display' has be shown or not, for that check position != 0.0) 82 84 * * For intf callback upon changes 83 85 * - intf-change … … 281 283 ***************************************************************************** 282 284 * Thread in charge of processing the network packets and demultiplexing. 285 * 286 * TODO: 287 * read subtitle support (XXX take care of spu-delay in the right way). 288 * multi-input support (XXX may be done with subs) 283 289 *****************************************************************************/ 284 290 static int Run( input_thread_t *p_input ) … … 674 680 demux2_Control( p_input->input.p_demux, DEMUX_CAN_PAUSE, 675 681 &p_input->input.b_can_pause ); 682 683 /* FIXME todo 684 demux2_Control( p_input->input.p_demux, DEMUX_CAN_SEEK, 685 &val.b_bool ); 686 */ 676 687 } 677 688 else … … 729 740 access2_Control( p_input->input.p_access, ACCESS_CAN_PAUSE, 730 741 &p_input->input.b_can_pace_control ); 742 access2_Control( p_input->input.p_access, ACCESS_CAN_SEEK, 743 &val.b_bool ); 744 var_Set( p_input, "seekable", val ); 731 745 732 746 /* Create the stream_t */ … … 1529 1543 break; 1530 1544 1545 case INPUT_CONTROL_SET_AUDIO_DELAY: 1546 input_EsOutSetDelay( p_input->p_es_out, 1547 AUDIO_ES, val.i_time ); 1548 var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, &val, NULL ); 1549 break; 1550 1551 case INPUT_CONTROL_SET_SPU_DELAY: 1552 input_EsOutSetDelay( p_input->p_es_out, 1553 SPU_ES, val.i_time ); 1554 var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val, NULL ); 1555 break; 1556 1531 1557 case INPUT_CONTROL_SET_TITLE: 1532 1558 case INPUT_CONTROL_SET_TITLE_NEXT: src/input/input_internal.h
r7291747 r2aebce7 57 57 58 58 INPUT_CONTROL_SET_ES, 59 60 INPUT_CONTROL_SET_AUDIO_DELAY, 61 INPUT_CONTROL_SET_SPU_DELAY, 59 62 }; 60 63 struct input_thread_sys_t … … 120 123 es_out_id_t *input_EsOutGetFromID( es_out_t *, int i_id ); 121 124 void input_EsOutDiscontinuity( es_out_t *, vlc_bool_t b_audio ); 125 void input_EsOutSetDelay( es_out_t *, int i_cat, int64_t ); 122 126 123 127 /* clock.c */ src/input/var.c
r51d78b6 r2aebce7 63 63 static int ESCallback ( vlc_object_t *p_this, char const *psz_cmd, 64 64 vlc_value_t oldval, vlc_value_t newval, void * ); 65 static int EsDelayCallback ( vlc_object_t *p_this, char const *psz_cmd, 66 vlc_value_t oldval, vlc_value_t newval, void * ); 67 65 68 static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd, 66 69 vlc_value_t oldval, vlc_value_t newval, void * ); … … 145 148 var_Change( p_input, "navigation", VLC_VAR_SETTEXT, &text, NULL ); 146 149 150 /* Delay */ 151 var_Create( p_input, "audio-delay", VLC_VAR_TIME ); 152 val.i_time = 0; 153 var_Change( p_input, "audio-delay", VLC_VAR_SETVALUE, &val, NULL ); 154 var_AddCallback( p_input, "audio-delay", EsDelayCallback, NULL ); 155 var_Create( p_input, "spu-delay", VLC_VAR_TIME ); 156 val.i_time = 0; 157 var_Change( p_input, "spu-delay", VLC_VAR_SETVALUE, &val, NULL ); 158 var_AddCallback( p_input, "spu-delay", EsDelayCallback, NULL ); 159 160 147 161 /* Video ES */ 148 162 var_Create( p_input, "video-es", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ); … … 193 207 var_Destroy( p_input, "time" ); 194 208 var_Destroy( p_input, "time-offset" ); 209 210 var_Destroy( p_input, "audio-delay" ); 211 var_Destroy( p_input, "spu-delay" ); 195 212 196 213 var_Destroy( p_input, "bookmark" ); … … 385 402 386 403 var_Create( p_input, "cr-average", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); 404 405 var_Create( p_input, "seekable", VLC_VAR_BOOL ); 406 val.b_bool = VLC_TRUE; /* Fixed later*/ 407 var_Change( p_input, "seekable", VLC_VAR_SETVALUE, &val, NULL ); 408 387 409 } 388 410 … … 624 646 } 625 647 648 static int EsDelayCallback ( vlc_object_t *p_this, char const *psz_cmd, 649 vlc_value_t oldval, vlc_value_t newval, void *p ) 650 { 651 input_thread_t *p_input = (input_thread_t*)p_this; 652 653 if( !strcmp( psz_cmd, "audio-delay" ) ) 654 input_ControlPush( p_input, INPUT_CONTROL_SET_AUDIO_DELAY, &newval ); 655 else if( !strcmp( psz_cmd, "spu-delay" ) ) 656 input_ControlPush( p_input, INPUT_CONTROL_SET_SPU_DELAY, &newval ); 657 return VLC_SUCCESS; 658 } 659 626 660 static int BookmarkCallback( vlc_object_t *p_this, char const *psz_cmd, 627 661 vlc_value_t oldval, vlc_value_t newval, void *p_data )
