mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-23 23:21:06 +01:00
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>
This commit is contained in:
parent
2c3b665379
commit
fc38bbcd6a
1 changed files with 2 additions and 0 deletions
2
ffplay.c
2
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue