Screw this found_* stuff, just wrap parse_*() in an if
git-svn-id: https://svn.musicpd.org/mpd/trunk@4465 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
13cca01c7b
commit
a570f8d9a9
@ -614,8 +614,6 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
|
|||||||
struct lame lame;
|
struct lame lame;
|
||||||
struct mad_bitptr ptr;
|
struct mad_bitptr ptr;
|
||||||
int bitlen;
|
int bitlen;
|
||||||
int found_xing;
|
|
||||||
int found_lame;
|
|
||||||
int ret;
|
int ret;
|
||||||
int skip;
|
int skip;
|
||||||
|
|
||||||
@ -637,17 +635,14 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
|
|||||||
ptr = data->stream.anc_ptr;
|
ptr = data->stream.anc_ptr;
|
||||||
bitlen = data->stream.anc_bitlen;
|
bitlen = data->stream.anc_bitlen;
|
||||||
|
|
||||||
found_xing = parse_xing(&xing, &ptr, &bitlen);
|
if (parse_xing(&xing, &ptr, &bitlen)) {
|
||||||
found_lame = (found_xing ? parse_lame(&lame, &ptr, &bitlen) : 0);
|
|
||||||
|
|
||||||
if (found_lame) {
|
|
||||||
data->dropSamplesAtStart = lame.encoderDelay + DECODERDELAY;
|
|
||||||
data->dropSamplesAtEnd = lame.encoderPadding;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found_xing) {
|
|
||||||
data->muteFrame = MUTEFRAME_SKIP;
|
data->muteFrame = MUTEFRAME_SKIP;
|
||||||
|
|
||||||
|
if (parse_lame(&lame, &ptr, &bitlen) : 0)
|
||||||
|
data->dropSamplesAtStart = lame.encoderDelay + DECODERDELAY;
|
||||||
|
data->dropSamplesAtEnd = lame.encoderPadding;
|
||||||
|
}
|
||||||
|
|
||||||
if (xing.flags & XING_FRAMES) {
|
if (xing.flags & XING_FRAMES) {
|
||||||
mad_timer_t duration = data->frame.header.duration;
|
mad_timer_t duration = data->frame.header.duration;
|
||||||
mad_timer_multiply(&duration, xing.frames);
|
mad_timer_multiply(&duration, xing.frames);
|
||||||
|
Loading…
Reference in New Issue
Block a user