comparison mplayer.c @ 22338:434cd072b0d3

Seek to -ss position without first starting audio/video from the start. Manual seeks no longer shift -endpos position (hopefully no one considered that a "feature").
author uau
date Tue, 27 Feb 2007 01:16:59 +0000
parents 5a5c7529e8a3
children baeb54a9c3e9
comparison
equal deleted inserted replaced
22337:d79bd226342d 22338:434cd072b0d3
3328 3328
3329 if(play_n_frames==0){ 3329 if(play_n_frames==0){
3330 mpctx->eof=PT_NEXT_ENTRY; goto goto_next_file; 3330 mpctx->eof=PT_NEXT_ENTRY; goto goto_next_file;
3331 } 3331 }
3332 3332
3333 if (seek_to_sec) {
3334 seek(mpctx, seek_to_sec, 1);
3335 end_at.pos += seek_to_sec;
3336 }
3337
3338 if (end_at.type == END_AT_SIZE) {
3339 mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_MPEndposNoSizeBased);
3340 end_at.type = END_AT_NONE;
3341 }
3342
3343
3333 while(!mpctx->eof){ 3344 while(!mpctx->eof){
3334 float aq_sleep_time=0; 3345 float aq_sleep_time=0;
3335 if(!mpctx->sh_audio && mpctx->d_audio->sh) { 3346 if(!mpctx->sh_audio && mpctx->d_audio->sh) {
3336 mpctx->sh_audio = mpctx->d_audio->sh; 3347 mpctx->sh_audio = mpctx->d_audio->sh;
3337 mpctx->sh_audio->ds = mpctx->d_audio; 3348 mpctx->sh_audio->ds = mpctx->d_audio;
3503 if (brk_cmd == 2) 3514 if (brk_cmd == 2)
3504 goto goto_enable_cache; 3515 goto goto_enable_cache;
3505 } 3516 }
3506 } 3517 }
3507 mpctx->was_paused = 0; 3518 mpctx->was_paused = 0;
3508
3509 if (seek_to_sec) {
3510 rel_seek_secs += seek_to_sec;
3511 seek_to_sec = 0;
3512 }
3513
3514 if (end_at.type != END_AT_NONE) {
3515 if(end_at.type == END_AT_SIZE) {
3516 mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_MPEndposNoSizeBased);
3517 end_at.type = END_AT_NONE;
3518 } else {
3519 end_at.pos += rel_seek_secs;
3520 }
3521 }
3522 3519
3523 /* Looping. */ 3520 /* Looping. */
3524 if(mpctx->eof==1 && loop_times>=0) { 3521 if(mpctx->eof==1 && loop_times>=0) {
3525 int l = loop_times; 3522 int l = loop_times;
3526 play_tree_iter_step(mpctx->playtree_iter,0,0); 3523 play_tree_iter_step(mpctx->playtree_iter,0,0);