diff options
author | Max Kellermann <max@duempel.org> | 2009-03-17 20:28:37 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-17 20:28:37 +0100 |
commit | 47bbb73ee1247a02413acfb66f5e4b7c3a5bc833 (patch) | |
tree | 1316538a3be6b1ca32b7fcaec80acf13b5a40fd6 /src/player_thread.c | |
parent | 7ba7e6732382542b632840f144b4782667fc2cd9 (diff) | |
download | mpd-47bbb73ee1247a02413acfb66f5e4b7c3a5bc833.tar.gz mpd-47bbb73ee1247a02413acfb66f5e4b7c3a5bc833.tar.xz mpd-47bbb73ee1247a02413acfb66f5e4b7c3a5bc833.zip |
player_thread: ignore time stamp on empty chunks
If a music_chunk does not contain any PCM data, then the "times" and
"bit_rate" attributes are undefined.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r-- | src/player_thread.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/player_thread.c b/src/player_thread.c index cc79eb3c2..59443696c 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -416,9 +416,6 @@ play_chunk(struct song *song, struct music_chunk *chunk, assert(music_chunk_check_format(chunk, format)); - pc.elapsed_time = chunk->times; - pc.bit_rate = chunk->bit_rate; - if (chunk->tag != NULL) { if (!song_is_file(song)) { /* always update the tag of remote streams */ @@ -439,6 +436,12 @@ play_chunk(struct song *song, struct music_chunk *chunk, } } + if (chunk->length == 0) + return true; + + pc.elapsed_time = chunk->times; + pc.bit_rate = chunk->bit_rate; + /* apply software volume */ success = pcm_volume(chunk->data, chunk->length, |