X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fplayer.cpp;h=5ea34ea64936a3b4c9fc71b671d6a4b2538e2ffb;hb=6206d17dcc22cc22d8aaf1d7396546d1191b4360;hp=b88aa56267e7b7e87f9747be3db8d96e25280e5a;hpb=68e6766a00d82d7448cda80cb4ffe79e2157dac9;p=nageru diff --git a/futatabi/player.cpp b/futatabi/player.cpp index b88aa56..5ea34ea 100644 --- a/futatabi/player.cpp +++ b/futatabi/player.cpp @@ -112,9 +112,10 @@ got_clip: double speed = 0.5; int64_t in_pts_start_next_clip = -1; + steady_clock::time_point next_frame_start; for (int frameno = 0; ; ++frameno) { // Ends when the clip ends. double out_pts = out_pts_origin + TIMEBASE * frameno / output_framerate; - steady_clock::time_point next_frame_start = + next_frame_start = origin + microseconds(lrint((out_pts - out_pts_origin) * 1e6 / TIMEBASE)); int64_t in_pts = lrint(in_pts_origin + TIMEBASE * frameno * speed / output_framerate); pts = lrint(out_pts); @@ -329,7 +330,7 @@ got_clip: got_next_clip = false; // Start the next clip from the point where the fade went out. - origin = steady_clock::now(); + origin = next_frame_start; in_pts_origin = in_pts_start_next_clip; goto got_clip; }