aboutsummaryrefslogtreecommitdiff
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-12 18:41:25 +0100
committerMax Kellermann <max@duempel.org>2009-11-12 18:41:25 +0100
commit76283c25a5f17873b37f18564e62f9e16ba2e90e (patch)
tree13744c8b258e9cb5447bc945d22f8e237b8f1c74 /src/player_thread.c
parentb9866e43d3311e9ce147442e378e12b2806b50ab (diff)
player_thread: initialize chunk->times in silence generator
When waiting for the decoder to provide more data, the player thread generates silence chunks if needed. However, it forgot to initialize the chunk.times attribute, which had now an undefined value. This patch sets it to -1.0, meaning "value is undefined". Add a ">= 0.0" check to audio_output_all_check(). This fixes spurious relative seeking errors, because sometimes, the "elapsed" value falls back to 0.0.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 0581b111..4f754241 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -333,6 +333,7 @@ player_send_silence(struct player *player)
chunk->audio_format = player->play_audio_format;
#endif
+ chunk->times = -1.0; /* undefined time stamp */
chunk->length = num_frames * frame_size;
memset(chunk->data, 0, chunk->length);