decoder_api: added function decoder_timestamp()

Remove the data_time parameter from decoder_data().  This patch
eliminates the timestamp counting in most decoder plugins, because the
MPD core will do it automatically by default.
This commit is contained in:
Max Kellermann
2009-12-25 19:47:33 +01:00
parent 870436a592
commit bad350bc18
22 changed files with 73 additions and 83 deletions

View File

@@ -383,7 +383,6 @@ static void
faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
{
GError *error = NULL;
float file_time;
float total_time = 0;
faacDecHandle decoder;
struct audio_format audio_format;
@@ -434,8 +433,6 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
/* the decoder loop */
file_time = 0.0;
do {
size_t frame_size;
const void *decoded;
@@ -481,15 +478,12 @@ faad_stream_decode(struct decoder *mpd_decoder, struct input_stream *is)
bit_rate = frame_info.bytesconsumed * 8.0 *
frame_info.channels * audio_format.sample_rate /
frame_info.samples / 1000 + 0.5;
file_time +=
(float)(frame_info.samples) / frame_info.channels /
audio_format.sample_rate;
}
/* send PCM samples to MPD */
cmd = decoder_data(mpd_decoder, is, decoded,
(size_t)frame_info.samples * 2, file_time,
(size_t)frame_info.samples * 2,
bit_rate, NULL);
} while (cmd != DECODE_COMMAND_STOP);