summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-03 17:15:03 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-10-03 17:15:03 +0200
commit8435239b97169828f95497dfebf180243efe6b70 (patch)
treeea83db146db02155b0c299698c040ff4758641a1 /plugins/mpgmad
parent107c24022634144e9872bb036920c66c863c6d78 (diff)
fixed seeking in vfs_curl
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index e4751a09..ffa5aac0 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -22,8 +22,8 @@
#include <stdlib.h>
#include "../../deadbeef.h"
-#define trace(...) { fprintf(stderr, __VA_ARGS__); }
-//#define trace(fmt,...)
+//#define trace(...) { fprintf(stderr, __VA_ARGS__); }
+#define trace(fmt,...)
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))
@@ -836,6 +836,20 @@ cmp3_seek_sample (int sample) {
int r = deadbeef->fseek (buffer.file, l, SEEK_SET);
if (!r) {
buffer.currentsample = sample;
+ plugin.info.readpos = (float)(buffer.currentsample - buffer.startsample) / buffer.samplerate;
+
+
+ mad_synth_finish (&synth);
+ mad_frame_finish (&frame);
+ mad_stream_finish (&stream);
+ buffer.remaining = 0;
+ buffer.readsize = 0;
+ buffer.cachefill = 0;
+ buffer.cachepos = 0;
+ mad_stream_init(&stream);
+ mad_frame_init(&frame);
+ mad_synth_init(&synth);
+
return 0;
}
return -1;