changeset 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 388b4cc85c0e
children 355bbee58b99
files DOCS/man/en/mplayer.1 mplayer.c
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Sat Dec 15 19:51:21 2012 +0000
+++ b/DOCS/man/en/mplayer.1	Sat Dec 15 19:53:28 2012 +0000
@@ -2085,6 +2085,7 @@
 .TP
 .B \-ss <time> (also see \-sb)
 Seek to given time position.
+Use \-ss nopts to disable seeking, \-ss 0 has different behaviour.
 .sp 1
 .I EXAMPLE:
 .PD 0
--- a/mplayer.c	Sat Dec 15 19:51:21 2012 +0000
+++ b/mplayer.c	Sat Dec 15 19:53:28 2012 +0000
@@ -203,7 +203,7 @@
 static char *term_osd_esc = "\x1b[A\r\x1b[K";
 static char *playing_msg;
 // seek:
-static double seek_to_sec;
+static double seek_to_sec = MP_NOPTS_VALUE;
 static off_t seek_to_byte;
 static off_t step_sec;
 static int loop_seek;
@@ -3702,7 +3702,7 @@
             goto goto_next_file;
         }
 
-        if (seek_to_sec) {
+        if (seek_to_sec != MP_NOPTS_VALUE) {
             seek(mpctx, seek_to_sec, SEEK_ABSOLUTE);
             end_at.pos += seek_to_sec;
         }