summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-09-21 22:21:53 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-09-21 22:21:53 +0200
commit2e35c3b0c20b5c5f9d645f2c26f19cb4fcf6445d (patch)
tree1cece533f5966d7997343bd5261314a8874a2169 /plugins/mpgmad
parent3b873783f1fd9df75154863770d5bb33a573062a (diff)
sample-accurate mp3 start/end points for cuesheets
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 dc328f93..b014ac91 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -645,8 +645,8 @@ cmp3_decode (void) {
int cachepos = (buffer.cachefill + buffer.cachepos) & CACHE_MASK;
int len = synth.pcm.length;
- if (buffer.currentsample + len >= buffer.totalsamples) {
- len = buffer.totalsamples - buffer.currentsample;
+ if (buffer.currentsample + len > buffer.endsample) {
+ len = buffer.endsample - buffer.currentsample + 1;
}
int i = min (synth.pcm.length, buffer.skipsamples);
if (buffer.skipsamples > 0) {
@@ -682,8 +682,8 @@ cmp3_decode (void) {
if (buffer.currentsample > buffer.totalsamples) {
trace ("mpgmad: warning: extra samples were read after end of stream\n");
}
- if (buffer.readsize <= 0 || eof || buffer.currentsample >= buffer.totalsamples) {
- if (buffer.currentsample >= buffer.totalsamples) {
+ if (buffer.readsize <= 0 || eof || buffer.currentsample > buffer.endsample) {
+ if (buffer.endsample >= buffer.endsample) {
trace ("finished at sample %d (%d)\n", buffer.currentsample, buffer.totalsamples);
}
break;