summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-04-22 18:14:28 +0200
committerGravatar waker <wakeroid@gmail.com>2011-04-22 18:14:28 +0200
commitdcbbc1249db1f45ebd039e9157dcb8131699a0f6 (patch)
tree02c6d0353af41f14617051527965e590fba9e3b8 /plugins/mpgmad
parent71d4cfe3989880ed94ed8f2d6d36f4c343b1e796 (diff)
mp3: applying decoder delay has been moved to init
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index b51fb159..9b1c59e4 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -551,11 +551,7 @@ cmp3_scan_stream (buffer_t *buffer, int sample) {
deadbeef->fseek (buffer->file, 2, SEEK_CUR);
deadbeef->fread (buf, 1, 3, buffer->file);
buffer->delay = (((uint32_t)buf[0]) << 4) | ((((uint32_t)buf[1]) & 0xf0)>>4);
- buffer->delay += 529;
buffer->padding = ((((uint32_t)buf[1])&0x0f)<<8) | ((uint32_t)buf[2]);
- if (buffer->padding >= 529) {
- buffer->padding -= 529;
- }
// skip
deadbeef->fseek (buffer->file, 1, SEEK_CUR);
// mp3gain
@@ -815,6 +811,10 @@ cmp3_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
trace ("mpgmad: cmp3_init: initial cmp3_scan_stream failed\n");
return -1;
}
+ info->buffer.delay += 529;
+ if (info->buffer.padding >= 529) {
+ info->buffer.padding -= 529;
+ }
if (it->endsample > 0) {
info->buffer.startsample = it->startsample + info->buffer.delay;
info->buffer.endsample = it->endsample + info->buffer.delay;