[FFmpeg-cvslog] ffplay: disallow seeking before the start of the file
Marton Balint
git at videolan.org
Thu Nov 29 03:25:38 CET 2012
ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Fri Nov 23 00:22:35 2012 +0100| [fc38bbcd6ab3cbb137ba64d3ec0c560d63b194cf] | committer: Marton Balint
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 at passwd.hu>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc38bbcd6ab3cbb137ba64d3ec0c560d63b194cf
---
ffplay.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ffplay.c b/ffplay.c
index 5ba5164..c5ad70f 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;
More information about the ffmpeg-cvslog
mailing list