aboutsummaryrefslogtreecommitdiffstats
path: root/src/MusicChunk.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/MusicChunk.cxx27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/MusicChunk.cxx b/src/MusicChunk.cxx
index 2d20ac7ac..3cfd232c0 100644
--- a/src/MusicChunk.cxx
+++ b/src/MusicChunk.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2013 The Music Player Daemon Project
+ * Copyright (C) 2003-2014 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -24,14 +24,14 @@
#include <assert.h>
-music_chunk::~music_chunk()
+MusicChunk::~MusicChunk()
{
delete tag;
}
#ifndef NDEBUG
bool
-music_chunk::CheckFormat(const AudioFormat other_format) const
+MusicChunk::CheckFormat(const AudioFormat other_format) const
{
assert(other_format.IsValid());
@@ -40,34 +40,31 @@ music_chunk::CheckFormat(const AudioFormat other_format) const
#endif
WritableBuffer<void>
-music_chunk::Write(const AudioFormat af,
- float data_time, uint16_t _bit_rate)
+MusicChunk::Write(const AudioFormat af,
+ SongTime data_time, uint16_t _bit_rate)
{
assert(CheckFormat(af));
assert(length == 0 || audio_format.IsValid());
if (length == 0) {
/* if the chunk is empty, nobody has set bitRate and
- times yet */
+ time yet */
bit_rate = _bit_rate;
- times = data_time;
- }
-
- const size_t frame_size = af.GetFrameSize();
- size_t num_frames = (sizeof(data) - length) / frame_size;
- if (num_frames == 0)
- return WritableBuffer<void>::Null();
+ time = data_time;
#ifndef NDEBUG
- audio_format = af;
+ audio_format = af;
#endif
+ }
+ const size_t frame_size = af.GetFrameSize();
+ size_t num_frames = (sizeof(data) - length) / frame_size;
return { data + length, num_frames * frame_size };
}
bool
-music_chunk::Expand(const AudioFormat af, size_t _length)
+MusicChunk::Expand(const AudioFormat af, size_t _length)
{
const size_t frame_size = af.GetFrameSize();