]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
para_play: Avoid invalid time display on pause.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 27 Jul 2022 13:27:14 +0000 (15:27 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 25 Aug 2022 13:35:23 +0000 (15:35 +0200)
When para_play enters pause mode, playback is stopped by notifying
the writer node, causing it to terminate in the next iteration of the
main loop. Until then the play time is computed incorrectly because
we add the running time of the moribund writer node to the start time
computed from the *new* start chunk set in com_pause().

Fortunately, the fix is simple. We just need to enqueue a reposition
request in the same way the ff and jmp commands do.

play.c

diff --git a/play.c b/play.c
index 14fac42fd7b6e92566815d4c56b1f4b6b23c88e2..ba9fff70190c7e150b136e15eb5375015897b2d0 100644 (file)
--- a/play.c
+++ b/play.c
@@ -854,6 +854,7 @@ static int com_pause(__a_unused struct lls_parse_result *lpr)
        ss = PARA_MAX(ss, 0UL);
        ss = PARA_MIN(ss, pt->num_chunks);
        pt->start_chunk = ss;
+       pt->rq = CRT_REPOS;
        kill_stream();
        return 0;
 }