From fb19210cfd3ec20d69f53ea258c36ef72e002edd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Sep 2011 22:59:11 +0200 Subject: decoder_internal.h: more API documentation --- src/decoder_internal.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/decoder_internal.h') diff --git a/src/decoder_internal.h b/src/decoder_internal.h index 9e7e2037a..2347fdf4e 100644 --- a/src/decoder_internal.h +++ b/src/decoder_internal.h @@ -36,6 +36,11 @@ struct decoder { */ double timestamp; + /** + * This flag is set by decoder_seek_where(), and checked by + * decoder_command_finished(). It is used to clean up after + * seeking. + */ bool seeking; /** -- cgit v1.2.3 From 525a791987c66ed2f8b1ca9e5357836f536fdb8b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Sep 2011 23:17:34 +0200 Subject: decoder_api: emulate SEEK command for initial seek to CUE track When playing a CUE track, the player thread waited for the decoder to become ready, and then sent a SEEK command to the beginning of the CUE track. If that is near the start of the song file, and the track is short enough, the decoder could have finished decoding already at that point, and seeking fails. This commit makes this initial seek more robust: instead of letting the player thread deal with the difficult timings, let the decoder API emulate a SEEK command, and return it to the decoder plugin, as soon as the plugin finishes its initialization. --- src/decoder_internal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/decoder_internal.h') diff --git a/src/decoder_internal.h b/src/decoder_internal.h index 2347fdf4e..5818632e5 100644 --- a/src/decoder_internal.h +++ b/src/decoder_internal.h @@ -36,6 +36,20 @@ struct decoder { */ double timestamp; + /** + * Is the initial seek (to the start position of the sub-song) + * pending, or has it been performed already? + */ + bool initial_seek_pending; + + /** + * Is the initial seek currently running? During this time, + * the decoder command is SEEK. This flag is set by + * decoder_get_virtual_command(), when the virtual SEEK + * command is generated for the first time. + */ + bool initial_seek_running; + /** * This flag is set by decoder_seek_where(), and checked by * decoder_command_finished(). It is used to clean up after -- cgit v1.2.3