summaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-05-22 23:08:07 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-05-22 23:08:07 +0000
commitc2b4c859a61f290b46252b0a884e888e81bd152c (patch)
tree129fb0a8b95e097e841b3db848c6bf38228bff5c /ffplay.c
parentecfe3929da6f5e53ca4d51e215b0c3597d2183cb (diff)
downloadffmpeg-streaming-c2b4c859a61f290b46252b0a884e888e81bd152c.zip
ffmpeg-streaming-c2b4c859a61f290b46252b0a884e888e81bd152c.tar.gz
fix mouse seeking when start time is not set, fix #1083
Originally committed as revision 18902 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 092a088..de2bf98 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2368,6 +2368,7 @@ static void event_loop(void)
break;
case SDL_MOUSEBUTTONDOWN:
if (cur_stream) {
+ int64_t ts;
int ns, hh, mm, ss;
int tns, thh, tmm, tss;
tns = cur_stream->ic->duration/1000000LL;
@@ -2381,7 +2382,10 @@ static void event_loop(void)
ss = (ns%60);
fprintf(stderr, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100,
hh, mm, ss, thh, tmm, tss);
- stream_seek(cur_stream, (int64_t)(cur_stream->ic->start_time+frac*cur_stream->ic->duration), 0);
+ ts = frac*cur_stream->ic->duration;
+ if (cur_stream->ic->start_time != AV_NOPTS_VALUE)
+ ts += cur_stream->ic->start_time;
+ stream_seek(cur_stream, ts, 0);
}
break;
case SDL_VIDEORESIZE:
OpenPOWER on IntegriCloud