fix some compile bugs related to RESERVOIR_TEST
authorJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 18 Apr 2001 23:02:08 +0000 (23:02 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Wed, 18 Apr 2001 23:02:08 +0000 (23:02 +0000)
src/plugin_xmms/plugin.c

index 32b3690..78953c2 100644 (file)
 #include "xmms/util.h"
 #include "FLAC/all.h"
 
 #include "xmms/util.h"
 #include "FLAC/all.h"
 
+#ifdef min
+#undef min
+#endif
+#define min(x,y) ((x)<(y)?(x):(y))
+
 typedef struct {
        byte raw[128];
        char title[31];
 typedef struct {
        byte raw[128];
        char title[31];
@@ -343,7 +348,7 @@ void *play_loop_(void *arg)
        while(file_info_.is_playing) {
                if(!file_info_.eof) {
                        while(reservoir_samples_ < SAMPLES_PER_WRITE) {
        while(file_info_.is_playing) {
                if(!file_info_.eof) {
                        while(reservoir_samples_ < SAMPLES_PER_WRITE) {
-                               if(decoder->state == FLAC__FILE_DECODER_END_OF_FILE) {
+                               if(decoder_->state == FLAC__FILE_DECODER_END_OF_FILE) {
                                        file_info_.eof = true;
                                        break;
                                }
                                        file_info_.eof = true;
                                        break;
                                }
@@ -360,7 +365,7 @@ void *play_loop_(void *arg)
                                        output_[i] = reservoir_[i];
                                delta = i;
                                for( ; i < reservoir_samples_*bytes_per_sample*channels; i++)
                                        output_[i] = reservoir_[i];
                                delta = i;
                                for( ; i < reservoir_samples_*bytes_per_sample*channels; i++)
-                                       reservoir[i-delta] = reservoir[i];
+                                       reservoir_[i-delta] = reservoir_[i];
                                reservoir_samples_ -= n;
 
                                flac_ip.add_vis_pcm(flac_ip.output->written_time(), file_info_.sample_format, channels, bytes, output_);
                                reservoir_samples_ -= n;
 
                                flac_ip.add_vis_pcm(flac_ip.output->written_time(), file_info_.sample_format, channels, bytes, output_);