aac: simplified fillAacBuffer()
Return instead of putting all the code into a if-closure. That saves one level of indentation.
This commit is contained in:
parent
1d18f0089a
commit
2a14141121
@ -39,9 +39,11 @@ typedef struct {
|
|||||||
|
|
||||||
static void fillAacBuffer(AacBuffer * b)
|
static void fillAacBuffer(AacBuffer * b)
|
||||||
{
|
{
|
||||||
if (b->bytesConsumed > 0) {
|
|
||||||
size_t bread;
|
size_t bread;
|
||||||
|
|
||||||
|
if (b->bytesConsumed == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (b->bytesIntoBuffer) {
|
if (b->bytesIntoBuffer) {
|
||||||
memmove((void *)b->buffer, (void *)(b->buffer +
|
memmove((void *)b->buffer, (void *)(b->buffer +
|
||||||
b->bytesConsumed),
|
b->bytesConsumed),
|
||||||
@ -61,22 +63,12 @@ static void fillAacBuffer(AacBuffer * b)
|
|||||||
|
|
||||||
b->bytesConsumed = 0;
|
b->bytesConsumed = 0;
|
||||||
|
|
||||||
if (b->bytesIntoBuffer > 3) {
|
if ((b->bytesIntoBuffer > 3 && memcmp(b->buffer, "TAG", 3) == 0) ||
|
||||||
if (memcmp(b->buffer, "TAG", 3) == 0)
|
(b->bytesIntoBuffer > 11 &&
|
||||||
|
memcmp(b->buffer, "LYRICSBEGIN", 11) == 0) ||
|
||||||
|
(b->bytesIntoBuffer > 8 && memcmp(b->buffer, "APETAGEX", 8) == 0))
|
||||||
b->bytesIntoBuffer = 0;
|
b->bytesIntoBuffer = 0;
|
||||||
}
|
}
|
||||||
if (b->bytesIntoBuffer > 11) {
|
|
||||||
if (memcmp(b->buffer, "LYRICSBEGIN", 11) == 0) {
|
|
||||||
b->bytesIntoBuffer = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (b->bytesIntoBuffer > 8) {
|
|
||||||
if (memcmp(b->buffer, "APETAGEX", 8) == 0) {
|
|
||||||
b->bytesIntoBuffer = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void advanceAacBuffer(AacBuffer * b, size_t bytes)
|
static void advanceAacBuffer(AacBuffer * b, size_t bytes)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user