summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-13 19:23:51 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-13 19:24:04 +0200
commitccaf593e039b0a19aa3cf4601ae283fe438224cd (patch)
tree34c33fa46ee04ed92b07408a6ede71fd6ed44d7b
parent78ecc1091f2023c194848ad15664cf4f7705a9bd (diff)
fixed initial mp3 duration calc
-rw-r--r--cmp3.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmp3.c b/cmp3.c
index eeea9831..366ce53a 100644
--- a/cmp3.c
+++ b/cmp3.c
@@ -276,7 +276,7 @@ cmp3_scan_stream (buffer_t *buffer, float position) {
}
}
else {
- packetlength = 0;
+ continue;
}
buffer->version = ver;
buffer->layer = layer;
@@ -1345,6 +1345,7 @@ cmp3_insert (playItem_t *after, const char *fname) {
}
fseek (fp, 0, SEEK_END);
int sz = ftell (fp);
+ assert (buffer.packetlength);
int nframes = sz / buffer.packetlength;
it->duration = nframes * buffer.frameduration;