summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmp3.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmp3.c b/cmp3.c
index 30082ffd..01d3910b 100644
--- a/cmp3.c
+++ b/cmp3.c
@@ -62,6 +62,7 @@ cmp3_scan_stream2 (float position);
int
cmp3_init (struct playItem_s *it) {
+ printf ("opening file %s\n", it->fname);
buffer.file = fopen (it->fname, "rb");
if (!buffer.file) {
return -1;
@@ -74,9 +75,12 @@ cmp3_init (struct playItem_s *it) {
mad_timer_reset(&timer);
if (it->duration <= 0) {
- it->duration = cmp3_scan_stream (-1);
+ it->duration = cmp3_scan_stream (-1); // scan entire stream, calc duration
rewind (buffer.file);
}
+ else {
+ cmp3_scan_stream (0); // load up to 1st frame
+ }
mad_stream_init(&stream);
mad_frame_init(&frame);
mad_synth_init(&synth);