commit d2dca76581231ec61ce6cc9a25cbf1494181799c
parent 362db82ca8f9caadfd56ee739451acb3fd0d0e0d
Author: Louis Burda <quent.burda@gmail.com>
Date: Sun, 10 Mar 2024 18:36:31 +0100
Fix cmd_seek lockup
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mplay.flac.c b/mplay.flac.c
@@ -267,12 +267,15 @@ decoder_init(const char *file)
static void
decoder_seek(size_t sample_pos)
{
+ size_t cnt;
+
while (decoder.sample_next < sample_pos) {
- decoder_process_frame(NULL);
+ decoder_process_frame(&cnt);
if (decoder.end) {
mplay_status(MPLAY_INFO_EXIT, "from seek");
exit(0);
}
+ decoder.sample_next += cnt;
}
decoder.sample_next = sample_pos;
}