diff options
author | waker <wakeroid@gmail.com> | 2009-08-10 20:08:53 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-10 20:08:53 +0200 |
commit | 38554844d56c75253a902698ad20efa662d221eb (patch) | |
tree | f128dc72637b8b64740dbc859b171bd1f44025a7 | |
parent | 64afdee10e69f6deffb15b2741d6886e99006b9b (diff) |
fixed cmp3 crashbug
-rw-r--r-- | cmp3.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |