comparison mplayer.c @ 23726:11abe5f3dcaa

Move loop_times into mpctx.
author albeu
date Mon, 09 Jul 2007 14:51:47 +0000
parents 21c28c2645fe
children ce7bb9afa58a
comparison
equal deleted inserted replaced
23725:a0432f65040e 23726:11abe5f3dcaa
198 .begin_skip = MP_NOPTS_VALUE, 198 .begin_skip = MP_NOPTS_VALUE,
199 .play_tree_step = 1, 199 .play_tree_step = 1,
200 .global_sub_pos = -1, 200 .global_sub_pos = -1,
201 .set_of_sub_pos = -1, 201 .set_of_sub_pos = -1,
202 .file_format = DEMUXER_TYPE_UNKNOWN, 202 .file_format = DEMUXER_TYPE_UNKNOWN,
203 .loop_times = -1,
203 #ifdef HAS_DVBIN_SUPPORT 204 #ifdef HAS_DVBIN_SUPPORT
204 .last_dvb_step = 1, 205 .last_dvb_step = 1,
205 #endif 206 #endif
206 }; 207 };
207 208
242 static char* playing_msg = NULL; 243 static char* playing_msg = NULL;
243 // seek: 244 // seek:
244 static double seek_to_sec; 245 static double seek_to_sec;
245 static off_t seek_to_byte=0; 246 static off_t seek_to_byte=0;
246 static off_t step_sec=0; 247 static off_t step_sec=0;
247 static int loop_times=-1;
248 static int loop_seek=0; 248 static int loop_seek=0;
249 249
250 static m_time_size_t end_at = { .type = END_AT_NONE, .pos = 0 }; 250 static m_time_size_t end_at = { .type = END_AT_NONE, .pos = 0 };
251 251
252 // A/V sync: 252 // A/V sync:
3324 //TODO: add desired (stream-based) sections here 3324 //TODO: add desired (stream-based) sections here
3325 if (mpctx->stream->type==STREAMTYPE_TV) mp_input_set_section("tv"); 3325 if (mpctx->stream->type==STREAMTYPE_TV) mp_input_set_section("tv");
3326 3326
3327 //==================== START PLAYING ======================= 3327 //==================== START PLAYING =======================
3328 3328
3329 if(loop_times>1) loop_times--; else 3329 if(mpctx->loop_times>1) mpctx->loop_times--; else
3330 if(loop_times==1) loop_times = -1; 3330 if(mpctx->loop_times==1) mpctx->loop_times = -1;
3331 3331
3332 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_StartPlaying); 3332 mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_StartPlaying);
3333 3333
3334 total_time_usage_start=GetTimer(); 3334 total_time_usage_start=GetTimer();
3335 audio_time_usage=0; video_time_usage=0; vout_time_usage=0; 3335 audio_time_usage=0; video_time_usage=0; vout_time_usage=0;
3526 } 3526 }
3527 } 3527 }
3528 mpctx->was_paused = 0; 3528 mpctx->was_paused = 0;
3529 3529
3530 /* Looping. */ 3530 /* Looping. */
3531 if(mpctx->eof==1 && loop_times>=0) { 3531 if(mpctx->eof==1 && mpctx->loop_times>=0) {
3532 mp_msg(MSGT_CPLAYER,MSGL_V,"loop_times = %d, eof = %d\n", loop_times,mpctx->eof); 3532 mp_msg(MSGT_CPLAYER,MSGL_V,"loop_times = %d, eof = %d\n", mpctx->loop_times,mpctx->eof);
3533 3533
3534 if(loop_times>1) loop_times--; else 3534 if(mpctx->loop_times>1) mpctx->loop_times--; else
3535 if(loop_times==1) loop_times=-1; 3535 if(mpctx->loop_times==1) mpctx->loop_times=-1;
3536 play_n_frames=play_n_frames_mf; 3536 play_n_frames=play_n_frames_mf;
3537 mpctx->eof=0; 3537 mpctx->eof=0;
3538 abs_seek_pos=1; rel_seek_secs=seek_to_sec; 3538 abs_seek_pos=1; rel_seek_secs=seek_to_sec;
3539 loop_seek = 1; 3539 loop_seek = 1;
3540 } 3540 }