aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-10-05 22:37:59 +0200
committerMax Kellermann <max@duempel.org>2011-10-05 23:15:22 +0200
commit64b0ba6da7975fdde774f188b1647ab6c9024cfa (patch)
treea27f708b535cf488d626480750d87e7124e36b2f /src/decoder_api.c
parent99d4ae0c1ae5522202d71381b40f55418e7d531a (diff)
downloadmpd-64b0ba6da7975fdde774f188b1647ab6c9024cfa.tar.gz
mpd-64b0ba6da7975fdde774f188b1647ab6c9024cfa.tar.xz
mpd-64b0ba6da7975fdde774f188b1647ab6c9024cfa.zip
decoder_control: add attributes start_ms, end_ms
Don't read song.start_ms and song.end_ms, let the player thread manage this logic instead.
Diffstat (limited to 'src/decoder_api.c')
-rw-r--r--src/decoder_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index bbe93eef0..bec271179 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -132,7 +132,7 @@ decoder_command_finished(struct decoder *decoder)
assert(music_pipe_empty(dc->pipe));
decoder->initial_seek_running = false;
- decoder->timestamp = dc->song->start_ms / 1000.;
+ decoder->timestamp = dc->start_ms / 1000.;
decoder_unlock(dc);
return;
}
@@ -165,7 +165,7 @@ double decoder_seek_where(G_GNUC_UNUSED struct decoder * decoder)
assert(dc->pipe != NULL);
if (decoder->initial_seek_running)
- return dc->song->start_ms / 1000.;
+ return dc->start_ms / 1000.;
assert(dc->command == DECODE_COMMAND_SEEK);
@@ -407,8 +407,8 @@ decoder_data(struct decoder *decoder,
decoder->timestamp += (double)nbytes /
audio_format_time_to_size(&dc->out_audio_format);
- if (dc->song->end_ms > 0 &&
- decoder->timestamp >= dc->song->end_ms / 1000.0)
+ if (dc->end_ms > 0 &&
+ decoder->timestamp >= dc->end_ms / 1000.0)
/* the end of this range has been reached:
stop decoding */
return DECODE_COMMAND_STOP;