decoder/mad: simplify variable initialization in FillBuffer()
This commit is contained in:
parent
6b8ca514bb
commit
1d74a029a2
@ -223,18 +223,14 @@ MadDecoder::Seek(long offset)
|
|||||||
inline bool
|
inline bool
|
||||||
MadDecoder::FillBuffer()
|
MadDecoder::FillBuffer()
|
||||||
{
|
{
|
||||||
size_t remaining, length;
|
size_t remaining = 0, length = READ_BUFFER_SIZE;
|
||||||
unsigned char *dest;
|
unsigned char *dest = input_buffer;
|
||||||
|
|
||||||
if (stream.next_frame != nullptr) {
|
if (stream.next_frame != nullptr) {
|
||||||
remaining = stream.bufend - stream.next_frame;
|
remaining = stream.bufend - stream.next_frame;
|
||||||
memmove(input_buffer, stream.next_frame, remaining);
|
memmove(input_buffer, stream.next_frame, remaining);
|
||||||
dest = input_buffer + remaining;
|
dest += remaining;
|
||||||
length = READ_BUFFER_SIZE - remaining;
|
length -= remaining;
|
||||||
} else {
|
|
||||||
remaining = 0;
|
|
||||||
length = READ_BUFFER_SIZE;
|
|
||||||
dest = input_buffer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we've exhausted the read buffer, so give up!, these potential
|
/* we've exhausted the read buffer, so give up!, these potential
|
||||||
|
Loading…
Reference in New Issue
Block a user