summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2012-11-23 00:22:35 +0100
committerMarton Balint <cus@passwd.hu>2012-11-28 21:39:50 +0100
commitfc38bbcd6ab3cbb137ba64d3ec0c560d63b194cf (patch)
tree783f70e1173ce0c3c236f203d378a67b160055fc /ffplay.c
parent2c3b665379de0358006199de8604e10323c1037a (diff)
ffplay: disallow seeking before the start of the file
In timestamp based seeking we update the external clock to the seek target, therefore we should use sane timestamps even if libavformat could handle seeking before the start of the file. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index 5ba5164173..c5ad70fd43 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2984,6 +2984,8 @@ static void event_loop(VideoState *cur_stream)
} else {
pos = get_master_clock(cur_stream);
pos += incr;
+ if (cur_stream->ic->start_time != AV_NOPTS_VALUE && pos < cur_stream->ic->start_time / (double)AV_TIME_BASE)
+ pos = cur_stream->ic->start_time / (double)AV_TIME_BASE;
stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0);
}
break;