standardize flac__ names
[platform/upstream/flac.git] / src / flac / decode.c
index 21558b8..6859d51 100644 (file)
@@ -22,7 +22,6 @@
 #else
 # include <unistd.h>
 #endif
-#include <assert.h> /* for FILE */
 #include <stdio.h> /* for FILE */
 #include <string.h> /* for strcmp() */
 #include "FLAC/all.h"
@@ -60,7 +59,7 @@ static void metadata_callback(const FLAC__FileDecoder *decoder, const FLAC__Stre
 static void error_callback(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
 static void print_stats(const stream_info_struct *stream_info);
 
-int decode_wav(const char *infile, const char *outfile, bool analysis_mode, analysis_options aopts, bool verbose, uint64 skip)
+int flac__decode_wav(const char *infile, const char *outfile, bool analysis_mode, analysis_options aopts, bool verbose, uint64 skip)
 {
        bool md5_failure = false;
        stream_info_struct stream_info;
@@ -78,7 +77,7 @@ int decode_wav(const char *infile, const char *outfile, bool analysis_mode, anal
        stream_info.frame_counter = 0;
        stream_info.fout = 0; /* initialized with an open file later if necessary */
 
-       assert(!(stream_info.test_only && stream_info.analysis_mode));
+       FLAC__ASSERT(!(stream_info.test_only && stream_info.analysis_mode));
 
        if(!stream_info.test_only) {
                if(0 == strcmp(outfile, "-")) {
@@ -171,7 +170,7 @@ wav_abort_:
        return 1;
 }
 
-int decode_raw(const char *infile, const char *outfile, bool analysis_mode, analysis_options aopts, bool verbose, uint64 skip, bool is_big_endian, bool is_unsigned_samples)
+int flac__decode_raw(const char *infile, const char *outfile, bool analysis_mode, analysis_options aopts, bool verbose, uint64 skip, bool is_big_endian, bool is_unsigned_samples)
 {
        bool md5_failure = false;
        stream_info_struct stream_info;
@@ -191,7 +190,7 @@ int decode_raw(const char *infile, const char *outfile, bool analysis_mode, anal
        stream_info.frame_counter = 0;
        stream_info.fout = 0; /* initialized with an open file later if necessary */
 
-       assert(!(stream_info.test_only && stream_info.analysis_mode));
+       FLAC__ASSERT(!(stream_info.test_only && stream_info.analysis_mode));
 
        if(!stream_info.test_only) {
                if(0 == strcmp(outfile, "-")) {
@@ -350,7 +349,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__FileDecoder *decoder,
        stream_info->samples_processed += wide_samples;
        stream_info->frame_counter++;
 
-       if(stream_info->verbose && !(stream_info->frame_counter & 0x1f))
+       if(stream_info->verbose && !(stream_info->frame_counter & 0x7f))
                print_stats(stream_info);
 
        if(stream_info->analysis_mode) {
@@ -441,7 +440,7 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__FileDecoder *decoder,
                                return FLAC__STREAM_DECODER_WRITE_ABORT;
                }
                else {
-                       assert(0);
+                       FLAC__ASSERT(0);
                }
        }
        return FLAC__STREAM_DECODER_WRITE_CONTINUE;