Fix for mp3 playback being glitchy after seeking.

Also, fix for incorrect VBR length if they don't have a XING header.
CQTexperiment
vspader 2007-02-17 15:11:56 +00:00
parent b021077fa6
commit 2d8ea06321
1 changed files with 3 additions and 3 deletions

View File

@ -241,7 +241,7 @@ int parse_headers(struct xing *xing, struct lame *lame, struct mad_bitptr ptr, u
bitrate += header.bitrate;
}
if (fast && frames >= N_AVERAGE_FRAMES)
if ((vbr && !has_xing) && fast && frames >= N_AVERAGE_FRAMES)
{
float frame_size = ((double)data_used) / N_AVERAGE_FRAMES;
frames = (_fileSize - tagsize) / frame_size;
@ -250,12 +250,11 @@ int parse_headers(struct xing *xing, struct lame *lame, struct mad_bitptr ptr, u
_duration.fraction /= N_AVERAGE_FRAMES;
mad_timer_multiply (&_duration, frames);
if (vbr && !has_xing) {
bitrate /= N_AVERAGE_FRAMES;
bitrate *= frames;
}
break;
}
}
@ -449,6 +448,7 @@ static inline signed int scale (mad_fixed_t sample)
else
{
remainder = 0;
_seekSkip = NO;
}
len = fread(_inputBuffer+remainder, 1, INPUT_BUFFER_SIZE-remainder, _inFd);