diff options
author | 2009-09-05 12:00:22 +0200 | |
---|---|---|
committer | 2009-09-05 12:00:22 +0200 | |
commit | 515679ac1eb9f6f5e73768182ff58894e9db0aba (patch) | |
tree | b69928483fc3151cf1d9d9a08e6a8ef0c178f764 /plugins | |
parent | 69b289f0e708f43c75b3d7cf5d43a4c6ec710760 (diff) |
fixed mp3 frame length calc for mpeg2 layer3
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mpgmad/mpgmad.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c index d359e717..c5135cba 100644 --- a/plugins/mpgmad/mpgmad.c +++ b/plugins/mpgmad/mpgmad.c @@ -415,25 +415,22 @@ cmp3_scan_stream (buffer_t *buffer, float position) { if (layer == 1) { samples_per_frame = 384; dur = (float)384 / samplerate; - packetlength = (12 * bitrate / samplerate + padding) * 4; } else if (layer == 2) { samples_per_frame = 1152; dur = (float)1152 / samplerate; - packetlength = 144 * bitrate / samplerate + padding; } else if (layer == 3) { if (ver == 1) { samples_per_frame = 1152; dur = (float)1152 / samplerate; - packetlength = 144 * bitrate / samplerate + padding; } else { samples_per_frame = 576; dur = (float)576 / samplerate; - packetlength = 144 * bitrate / samplerate + padding; } } + packetlength = samples_per_frame / 8 * bitrate / samplerate + padding; } else { continue; |