Mercurial > mplayer.hg
comparison mplayer.c @ 35591:912ea01174c1
Allow -ss 0 to seek to pts 0 instead of disabling seeking.
This is useful for files that start with negative timestamps.
author | reimar |
---|---|
date | Sat, 15 Dec 2012 19:53:28 +0000 |
parents | 06aa6dc71613 |
children | 355bbee58b99 |
comparison
equal
deleted
inserted
replaced
35590:388b4cc85c0e | 35591:912ea01174c1 |
---|---|
201 | 201 |
202 int term_osd = 1; | 202 int term_osd = 1; |
203 static char *term_osd_esc = "\x1b[A\r\x1b[K"; | 203 static char *term_osd_esc = "\x1b[A\r\x1b[K"; |
204 static char *playing_msg; | 204 static char *playing_msg; |
205 // seek: | 205 // seek: |
206 static double seek_to_sec; | 206 static double seek_to_sec = MP_NOPTS_VALUE; |
207 static off_t seek_to_byte; | 207 static off_t seek_to_byte; |
208 static off_t step_sec; | 208 static off_t step_sec; |
209 static int loop_seek; | 209 static int loop_seek; |
210 | 210 |
211 static m_time_size_t end_at = { .type = END_AT_NONE, .pos = 0 }; | 211 static m_time_size_t end_at = { .type = END_AT_NONE, .pos = 0 }; |
3700 if (play_n_frames == 0) { | 3700 if (play_n_frames == 0) { |
3701 mpctx->eof = PT_NEXT_ENTRY; | 3701 mpctx->eof = PT_NEXT_ENTRY; |
3702 goto goto_next_file; | 3702 goto goto_next_file; |
3703 } | 3703 } |
3704 | 3704 |
3705 if (seek_to_sec) { | 3705 if (seek_to_sec != MP_NOPTS_VALUE) { |
3706 seek(mpctx, seek_to_sec, SEEK_ABSOLUTE); | 3706 seek(mpctx, seek_to_sec, SEEK_ABSOLUTE); |
3707 end_at.pos += seek_to_sec; | 3707 end_at.pos += seek_to_sec; |
3708 } | 3708 } |
3709 | 3709 |
3710 #ifdef CONFIG_DVDNAV | 3710 #ifdef CONFIG_DVDNAV |