minor formatting
authorJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 27 Aug 2002 05:46:11 +0000 (05:46 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Tue, 27 Aug 2002 05:46:11 +0000 (05:46 +0000)
35 files changed:
doc/html/ru/documentation.html
doc/html/ru/format.html
include/FLAC++/metadata.h
include/FLAC/file_decoder.h
include/FLAC/file_encoder.h
include/FLAC/format.h
include/FLAC/seekable_stream_decoder.h
include/FLAC/seekable_stream_encoder.h
include/FLAC/stream_decoder.h
include/OggFLAC/stream_decoder.h
src/libFLAC++/Makefile.am
src/libFLAC++/metadata.cc
src/libFLAC/bitbuffer.c
src/libFLAC/format.c
src/libFLAC/lpc.c
src/libFLAC/metadata_iterators.c
src/libFLAC/seekable_stream_encoder.c
src/libOggFLAC++/Makefile.am
src/libOggFLAC/stream_decoder.c
src/libOggFLAC/stream_encoder.c
src/test_libFLAC++/decoders.cc
src/test_libFLAC++/encoders.cc
src/test_libFLAC++/metadata_manip.cc
src/test_libFLAC++/metadata_object.cc
src/test_libFLAC/decoders.c
src/test_libFLAC/encoders.c
src/test_libFLAC/metadata_manip.c
src/test_libFLAC/metadata_object.c
src/test_libFLAC/metadata_utils.c
src/test_libOggFLAC++/decoders.cc
src/test_libOggFLAC++/encoders.cc
src/test_libOggFLAC/decoders.c
src/test_libOggFLAC/encoders.c
src/test_libOggFLAC/metadata_utils.c
strip_fPIC.sh

index 57ee8ec..7913d10 100644 (file)
 ÷òî èõ äëèíû áóäóò êðàòíû ðàçìåðó ñåêòîðà CD-Audio (ðàâíû 1/75 ñåêóíäàì èëè 588 ñýìïëàì). Ýòî îñóùåñòâëÿåòñÿ ïåðåíîñîì ÷àñòè ñåêòîðà â êîíöå êàæäîãî WAVE ôàéëà â íà÷àëî ñëåäóþùåãî. Ïîñëåäíèé ïîòîê áóäåò äîïîëíåí äî ãðàíèöû âûðàâíèâàíèÿ íóëÿìè.</P>
 <P>Èñïîëüçîâàíèå ýòîé îïöèè íå ïðèâåäåò íè ê ÷åìó, åñëè ôàéëû óæå âûðîâíåíû (íàïðèìåð, åñëè ïðàâèëüíî ñêîïèðîâàíû ñ àóäèî-CD). <TT><B>flac</B></TT> ìîæåò âûðîâíÿòü òîëüêî íåñêîëüêî ôàéëîâ çà îäèí âûçîâ.</P>
 
-<P><B>ÂÍÈÌÀÍÈÅ</B>: Ïîðÿäîê ôàéëîâ èìååò çíà÷åíèå! Åñëè âû ñäåëàåòå ñëåäóþùèé âûçîâ '<TT>flac --sector-align *.wav</TT>', êîìàíäíûé ïðîöåññîð ìîæåò îáðàáîòàòü øàáëîí íå â òîì ïîðÿäêå, â êàêîì âû ðàññ÷èòûâàåòå. Ïîýòîìó ëó÷øå âñåãî âûçûâàòü ïðîãðàììó, ÿâíî óêàçàâ ñïèñîê ôàéëîâ, íàïðèìåð, '<TT>flac --sector-align 8.wav 9.wav 10.wav</TT>'. 
+<P><B>ÂÍÈÌÀÍÈÅ</B>: Ïîðÿäîê ôàéëîâ èìååò çíà÷åíèå! Åñëè âû ñäåëàåòå ñëåäóþùèé âûçîâ '<TT>flac --sector-align *.wav</TT>', êîìàíäíûé ïðîöåññîð ìîæåò îáðàáîòàòü øàáëîí íå â òîì ïîðÿäêå, â êàêîì âû ðàññ÷èòûâàåòå. Ïîýòîìó ëó÷øå âñåãî âûçûâàòü ïðîãðàììó, ÿâíî óêàçàâ ñïèñîê ôàéëîâ, íàïðèìåð, '<TT>flac --sector-align 8.wav 9.wav 10.wav</TT>'.
 </TD></TR>
 
 <TR><TD><TT>-S {#|X|#x}</TT></TD>
 
 <UL>
     <LI><TT>#&nbsp;</TT> : ñîçäàåòñÿ òî÷êà ïîèñêà äëÿ ñýìïëà ñ îïðåäåëåííûì íîìåðîì.</LI>
-    
+
     <LI><TT>X&nbsp;</TT> : ðåçåðâèðóåìûå òî÷êè (âñåãäà ïîìåùàþòñÿ â êîíöå <TT>SEEKTABLE</TT>).</LI>
-    
+
     <LI><TT>#x</TT> : # ðàâíîìåðíî ðàñïðåäåëåííûõ òî÷åê ïîèñêà, ïåðâàÿ ñîîòâåòñòâóåò 0 ñýìïëó.</LI>
 </UL>
 
 
 <OL>
        <LI>Ïðîãðàììà ñîçäàåò ýêçåìïëÿð êîäåðà èëè äåêîäåðà ñ ïîìîùüþ ôóíêöèé <TT>*_new()</TT>.</LI>
-       
+
        <LI>Ïðîãðàììà óñòàíàâëèâàåò ïàðàìåòðû ýêçåìïëÿðà è ïðåäîñòàâëÿåò åìó îáðàòíûå âûçîâû äëÿ ÷òåíèÿ, çàïèñè, ñîîáùåíèÿ îá îøèáêàõ è ðàáîòû ñ ìåòàäàííûìè ñ ïîìîùüþ ôóíêöèé <TT>*_set_*()</TT>.</LI>
-       
+
        <LI>Ïðîãðàììà èíèöèàëèçèðóåò ýêçåìïëÿð, ïðîâåðÿåò ïàðàìåòðû è ãîòîâèòñÿ ê êîäèðîâàíèþ/äåêîäèðîâàíèþ, èñïîëüçóÿ ôóíêöèè <TT>*_init()</TT>.</LI>
-       
+
        <LI>Ïðîãðàììà âûçûâàåò ôóíêöèè <TT>*_process_*()</TT> äëÿ êîäèðîâàíèÿ èëè äåêîäèðîâàíèÿ äàííûõ, êîòîðûå â ñâîþ î÷åðåäü äåëàþò îáðàòíûå âûçîâû.</LI>
-       
+
        <LI>Ïðîãðàììà çàâåðøàåò ðàáîòó ýêçåìïëÿðà ôóíêöèåé <TT>*_finish()</TT>, êîòîðàÿ ñáðàñûâàåò áóôåðû ââîäà è âûâîäà.</LI>
-       
+
        <LI>Ýêçåìïëÿð ìîæåò áûòü èñïîëüçîâàí ñíîâà ëèáî óäàëåí ôóíêöèåé <TT>*_delete()</TT>.</LI>
 
 </OL>
 \r
 
 <P><B>ÄÅÊÎÄÅРÏÎÒÎÊÎÂ</B></P>
+
 <P>Ñíà÷àëà îáñóäèì äåêîäåð ïîòîêîâ. Òèï åãî ýêçåìïëÿðà <TT>FLAC__StreamDecoder</TT>. Îáû÷íî â ïðîãðàììå ýêçåìïëÿð ñîçäàåòñÿ âûçîâîì <TT>FLAC__stream_decoder_new()</TT>, çàòåì âûçûâàåò ôóíêöèè <TT>FLAC__stream_decoder_set_*()</TT> äëÿ óñòàíîâêè îáðàòíûõ âûçîâîâ è ïîëüçîâàòåëüñêèõ äàííûõ è èíèöèàëèçèðóåòñÿ ôóíêöèåé <TT>FLAC__stream_decoder_init()</TT>. Íåîáõîäèìûå îáðàòíûå âûçîâû:</P>
 
 <UL>
        <LI><B><TT>FLAC__stream_decoder_process_whole_stream()</TT></B> - Äåêîäåð íà÷èíàåò ðàáîòó è ïðîäîëæàåò îáðàáàòûâàòü ïîòîê ïîêà ôóíêöèÿ îáðàòíîãî âûçîâà ÷òåíèÿ íå ïåðåäàñò êîä <TT>FLAC__STREAM_DECODER_READ_END_OF_STREAM</TT> èëè <TT>FLAC__STREAM_DECODER_READ_ABORT</TT>.</LI>
 
        <LI><B><TT>FLAC__stream_decoder_process_metadata()</TT></B> - Äåêîäåð îáðàáàòûâàåò ïîòîê äî ïåðâîãî àóäèî ôðåéìà.</LI>
-       
+
        <LI><B><TT>FLAC__stream_decoder_process_one_frame()</TT></B> - Äåêîäåðîâàòü òîëüêî îäèí ôðåéì. Ïåðåä âûçîâîì ýòîé ôóíêöèè âñå ìåòàäàííûå äîëæíû áûòü îáðàáîòàíû.</LI>
 
        <LI><B><TT>FLAC__stream_decoder_process_remaining_frames()</TT></B> - Äåêîäèðîâàòü âñå îñòàâøèåñÿ ôðåéìû.  Ïåðåä âûçîâîì ýòîé ôóíêöèè âñå ìåòàäàííûå äîëæíû áûòü îáðàáîòàíû. Ïåðåä âûçîâîì ýòîé ôóíöèè òàêæå ìîæåò âûçûâàòüñÿ <TT>FLAC__stream_decoder_process_one_frame()</TT>.</LI>
index b517779..e5f6f0b 100644 (file)
 
     <UL>
         <LI>Çíà÷åíèå áèòîâ, îòâå÷àþùèõ çà ðàçìåð áëîêà, äîëæíî áûòü â ïðåäåëàõ 0001-0101 èëè 1000-1111. Ïîòîê äîëæåí ñîñòîÿòü èç áëîêîâ îäèíàêîâîãî ðàçìåðà (çà èñêëþ÷åíèåì ïîñëåäíåãî), à â áëîêå ìåòàäàííûõ <TT>STREAMINFO</TT> äîëæíû áûòü óêàçàíû ðàâíûå çíà÷åíèÿ äëÿ ìèíèìàëüíîãî è ìàêñèìàëüíîãî ðàçìåðà áëîêà.</LI>
-  
+
         <LI>Êîëè÷åñòâî áèò íà ñýìïë â çàãîëîâêå ôðåéìà äîëæíî îïèñûâàòüñÿ ñëåäóþùèì äèàïàçîíîì áèòîâ 001-110.</LI>
-   
+
         <LI>×àñòîòà äèñêðåòèçàöèè â çàãîëîâêå ôðåéìà äîëæíà îïèñûâàòüñÿ ñëåäóþùèì äèàïàçîíîì áèòîâ 0001-1011.</LI>
     </UL>
 </BLOCKQUOTE></P>
index 842b8e8..6b34e2d 100644 (file)
@@ -192,22 +192,22 @@ namespace FLAC {
                        inline void set_reference(bool x) { is_reference_ = x; }
                };
 
-               inline bool Prototype::operator==(const Prototype &object) const 
+               inline bool Prototype::operator==(const Prototype &object) const
                { return (bool)::FLAC__metadata_object_is_equal(object_, object.object_); }
 
-               inline bool Prototype::operator==(const ::FLAC__StreamMetadata &object) const 
+               inline bool Prototype::operator==(const ::FLAC__StreamMetadata &object) const
                { return (bool)::FLAC__metadata_object_is_equal(object_, &object); }
 
-               inline bool Prototype::operator==(const ::FLAC__StreamMetadata *object) const 
+               inline bool Prototype::operator==(const ::FLAC__StreamMetadata *object) const
                { return (bool)::FLAC__metadata_object_is_equal(object_, object); }
 
-               inline bool Prototype::operator!=(const Prototype &object) const 
+               inline bool Prototype::operator!=(const Prototype &object) const
                { return !operator==(object); }
 
-               inline bool Prototype::operator!=(const ::FLAC__StreamMetadata &object) const 
+               inline bool Prototype::operator!=(const ::FLAC__StreamMetadata &object) const
                { return !operator==(object); }
 
-               inline bool Prototype::operator!=(const ::FLAC__StreamMetadata *object) const 
+               inline bool Prototype::operator!=(const ::FLAC__StreamMetadata *object) const
                { return !operator==(object); }
 
                inline bool Prototype::is_valid() const
index f6a4443..2d1f2e2 100644 (file)
@@ -81,7 +81,7 @@ extern "C" {
  * automatically turned off if there is no signature in the STREAMINFO
  * block or when a seek is attempted.
  *
- * Make sure to read the detailed descriptions of the 
+ * Make sure to read the detailed descriptions of the
  * \link flac_seekable_stream_decoder seekable stream decoder module \endlink
  * and \link flac_stream_decoder stream decoder module \endlink
  * since the file decoder inherits much of its behavior from them.
@@ -107,16 +107,16 @@ extern "C" {
  */
 typedef enum {
 
-    FLAC__FILE_DECODER_OK = 0,
+       FLAC__FILE_DECODER_OK = 0,
        /**< The decoder is in the normal OK state. */
 
        FLAC__FILE_DECODER_END_OF_FILE,
        /**< The decoder has reached the end of the file. */
 
-    FLAC__FILE_DECODER_ERROR_OPENING_FILE,
+       FLAC__FILE_DECODER_ERROR_OPENING_FILE,
        /**< An error occurred opening the input file. */
 
-    FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
+       FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR,
        /**< An error occurred allocating memory. */
 
        FLAC__FILE_DECODER_SEEK_ERROR,
@@ -125,18 +125,18 @@ typedef enum {
        FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR,
        /**< An error occurred in the underlying seekable stream decoder. */
 
-    FLAC__FILE_DECODER_ALREADY_INITIALIZED,
+       FLAC__FILE_DECODER_ALREADY_INITIALIZED,
        /**< FLAC__file_decoder_init() was called when the decoder was already
         * initialized, usually because FLAC__file_decoder_finish() was not
-     * called.
+        * called.
         */
 
-    FLAC__FILE_DECODER_INVALID_CALLBACK,
+       FLAC__FILE_DECODER_INVALID_CALLBACK,
        /**< FLAC__file_decoder_init() was called without all callbacks
         * being set.
         */
 
-    FLAC__FILE_DECODER_UNINITIALIZED
+       FLAC__FILE_DECODER_UNINITIALIZED
        /**< The decoder is in the uninitialized state. */
 
 } FLAC__FileDecoderState;
index a5b017c..e8fd477 100644 (file)
@@ -107,7 +107,7 @@ typedef enum {
        FLAC__FILE_ENCODER_FATAL_ERROR_WHILE_WRITING,
        /**< A fatal error occurred while writing to the encoded file. */
 
-    FLAC__FILE_ENCODER_ERROR_OPENING_FILE,
+       FLAC__FILE_ENCODER_ERROR_OPENING_FILE,
        /**< An error occurred opening the output file for writing. */
 
        FLAC__FILE_ENCODER_MEMORY_ALLOCATION_ERROR,
index 0ac6e3b..7e639b8 100644 (file)
@@ -172,7 +172,7 @@ extern const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */
 typedef enum {
        FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0
        /**< Residual is coded by partitioning into contexts, each with it's own
-     * Rice parameter. */
+        * Rice parameter. */
 } FLAC__EntropyCodingMethodType;
 
 /** Maps a FLAC__EntropyCodingMethodType to a C string.
index 5624512..a91a4a3 100644 (file)
@@ -118,7 +118,7 @@ extern "C" {
  */
 typedef enum {
 
-    FLAC__SEEKABLE_STREAM_DECODER_OK = 0,
+       FLAC__SEEKABLE_STREAM_DECODER_OK = 0,
        /**< The decoder is in the normal OK state. */
 
        FLAC__SEEKABLE_STREAM_DECODER_SEEKING,
@@ -141,18 +141,18 @@ typedef enum {
         * callback returned an error.
         */
 
-    FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED,
+       FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED,
        /**< FLAC__seekable_stream_decoder_init() was called when the
         * decoder was already initialized, usually because
         * FLAC__seekable_stream_decoder_finish() was not called.
         */
 
-    FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK,
+       FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK,
        /**< FLAC__seekable_stream_decoder_init() was called without all
         * callbacks being set.
         */
 
-    FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
+       FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED
        /**< The decoder is in the uninitialized state. */
 
 } FLAC__SeekableStreamDecoderState;
index 1751817..50caa59 100644 (file)
@@ -100,12 +100,12 @@ typedef enum {
         * FLAC__seekable_stream_encoder_finish() was not called.
         */
 
-    FLAC__SEEKABLE_STREAM_ENCODER_INVALID_CALLBACK,
+       FLAC__SEEKABLE_STREAM_ENCODER_INVALID_CALLBACK,
        /**< FLAC__seekable_stream_encoder_init() was called without all
         * callbacks being set.
         */
 
-    FLAC__SEEKABLE_STREAM_ENCODER_INVALID_SEEKTABLE,
+       FLAC__SEEKABLE_STREAM_ENCODER_INVALID_SEEKTABLE,
        /**< An invalid seek table was passed is the metadata to
         * FLAC__seekable_stream_encoder_set_metadata().
         */
index 9ab781b..cc089b7 100644 (file)
@@ -154,7 +154,7 @@ extern "C" {
  * blocks to return.  Remember that some metadata blocks can be big so
  * filtering out the ones you don't use can reduce the memory requirements
  * of the decoder.  Also note the special forms
- * FLAC__stream_decoder_respond_application(id) and 
+ * FLAC__stream_decoder_respond_application(id) and
  * FLAC__stream_decoder_ignore_application(id) for filtering APPLICATION
  * blocks based on the application ID.
  *
@@ -726,7 +726,7 @@ FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder);
  *  called with the decoded metadata block or audio frame, unless an error
  *  occurred.  If the decoder loses sync it will call the error callback
  *  instead.
- * 
+ *
  * \param  decoder  An initialized decoder instance in the state
  *                  \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC.
  * \assert
@@ -751,7 +751,7 @@ FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder);
  *  As each metadata block is decoded, the metadata callback will be called
  *  with the decoded metadata.  If the decoder loses sync it will call the
  *  error callback.
- * 
+ *
  * \param  decoder  An initialized decoder instance in the state
  *                  \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA.
  * \assert
@@ -776,7 +776,7 @@ FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecode
  *  As each metadata block and frame is decoded, the metadata or write
  *  callback will be called with the decoded metadata or frame.  If the
  *  decoder loses sync it will call the error callback.
- * 
+ *
  * \param  decoder  An initialized decoder instance in the state
  *                  \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA.
  * \assert
index 6de2897..6c27116 100644 (file)
@@ -506,7 +506,7 @@ FLAC__bool OggFLAC__stream_decoder_reset(OggFLAC__StreamDecoder *decoder);
 
 /** Decode one metadata block or audio frame.
  *  This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_process_single()
- * 
+ *
  * \param  decoder  An initialized decoder instance in the state
  *                  \c OggFLAC__STREAM_DECODER_OK.
  * \assert
@@ -523,7 +523,7 @@ FLAC__bool OggFLAC__stream_decoder_process_single(OggFLAC__StreamDecoder *decode
 
 /** Decode until the end of the metadata.
  *  This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_process_until_end_of_metadata()
- * 
+ *
  * \param  decoder  An initialized decoder instance in the state
  *                  \c OggFLAC__STREAM_DECODER_OK.
  * \assert
@@ -540,7 +540,7 @@ FLAC__bool OggFLAC__stream_decoder_process_until_end_of_metadata(OggFLAC__Stream
 
 /** Decode until the end of the stream.
  *  This is inherited from FLAC__StreamDecoder; see FLAC__stream_decoder_process_until_end_of_stream()
- * 
+ *
  * \param  decoder  An initialized decoder instance in the state
  *                  \c OggFLAC__STREAM_DECODER_OK.
  * \assert
index 9988679..91d8f25 100644 (file)
@@ -37,4 +37,4 @@ libFLAC___la_SOURCES = \
        seekable_stream_decoder.cc \
        seekable_stream_encoder.cc \
        stream_decoder.cc \
-       stream_encoder.cc 
+       stream_encoder.cc
index b6fbb6e..e2abf81 100644 (file)
@@ -950,7 +950,7 @@ namespace FLAC {
                        return (bool)::FLAC__metadata_iterator_prev(iterator_);
                }
 
-               ::FLAC__MetadataType Iterator::get_block_type() const 
+               ::FLAC__MetadataType Iterator::get_block_type() const
                {
                        FLAC__ASSERT(is_valid());
                        return ::FLAC__metadata_iterator_get_block_type(iterator_);
index c0e0078..5220c6d 100644 (file)
@@ -2081,7 +2081,7 @@ FLAC__bool FLAC__bitbuffer_read_rice_signed_block(FLAC__BitBuffer *bb, int vals[
                                                CRC16_UPDATE_BLURB(bb, save_blurb, bb->read_crc16);
                                                break;
                                        }
-                               }       
+                               }
                                else {
                                        msbs += FLAC__BITS_PER_BLURB - cbits;
                                        cbits = 0;
@@ -2171,7 +2171,7 @@ FLAC__bool FLAC__bitbuffer_read_rice_signed_block(FLAC__BitBuffer *bb, int vals[
                                                        CRC16_UPDATE_BLURB(bb, save_blurb, bb->read_crc16);
                                                        break;
                                                }
-                                       }       
+                                       }
                                        else {
                                                msbs += FLAC__BITS_PER_BLURB - cbits;
                                                cbits = 0;
index cf933cf..4e35c43 100644 (file)
@@ -126,7 +126,7 @@ FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate)
                sample_rate == 0 ||
                sample_rate > FLAC__MAX_SAMPLE_RATE ||
                (
-                       sample_rate >= (1u << 16) && 
+                       sample_rate >= (1u << 16) &&
                        !(sample_rate % 1000 == 0 || sample_rate % 10 == 0)
                )
        ) {
index b993599..88c9a6c 100644 (file)
@@ -147,7 +147,7 @@ redo_it:
        else {
                int log2cmax;
 
-               (void)frexp(cmax, &log2cmax);   
+               (void)frexp(cmax, &log2cmax);
                log2cmax--;
                *shift = (int)precision - log2cmax - 1;
 
index 636db10..70d78b3 100644 (file)
@@ -1619,7 +1619,7 @@ FLAC__Metadata_SimpleIteratorStatus write_metadata_block_data_padding_(FILE *fil
                        return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR;
 
        n %= 1024;
-       
+
        if(fwrite(buffer, 1, n, file) != n)
                return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR;
 
index d36b6a3..320ad8d 100644 (file)
@@ -186,7 +186,7 @@ FLAC__SeekableStreamEncoderState FLAC__seekable_stream_encoder_init(FLAC__Seekab
         * Initializing the stream encoder writes all the metadata, so we
         * save the stream offset now.
         */
-       encoder->private_->stream_offset = encoder->private_->bytes_written; 
+       encoder->private_->stream_offset = encoder->private_->bytes_written;
 
        return encoder->protected_->state = FLAC__SEEKABLE_STREAM_ENCODER_OK;
 }
@@ -407,7 +407,7 @@ FLAC__bool FLAC__seekable_stream_encoder_set_metadata(FLAC__SeekableStreamEncode
        if(0 != metadata && num_blocks > 0) {
                unsigned i;
                for(i = 0; i < num_blocks; i++) {
-                       if(0 != metadata[i] && metadata[i]->type == FLAC__METADATA_TYPE_SEEKTABLE) {    
+                       if(0 != metadata[i] && metadata[i]->type == FLAC__METADATA_TYPE_SEEKTABLE) {
                                encoder->private_->seek_table = &metadata[i]->data.seek_table;
                                break; /* take only the first one */
                        }
index 1d8f1ca..b2af48b 100644 (file)
@@ -32,4 +32,4 @@ libOggFLAC___la_LDFLAGS = -version-info 0:0:0
 
 libOggFLAC___la_SOURCES = \
        stream_decoder.cc \
-       stream_encoder.cc 
+       stream_encoder.cc
index 958f9f4..41e6803 100644 (file)
@@ -132,7 +132,7 @@ void OggFLAC__stream_decoder_delete(OggFLAC__StreamDecoder *decoder)
 
        OggFLAC__stream_decoder_finish(decoder);
 
-    FLAC__stream_decoder_delete(decoder->private_->FLAC_stream_decoder);
+       FLAC__stream_decoder_delete(decoder->private_->FLAC_stream_decoder);
 
        free(decoder->private_);
        free(decoder->protected_);
@@ -161,14 +161,14 @@ OggFLAC__StreamDecoderState OggFLAC__stream_decoder_init(OggFLAC__StreamDecoder
        if(ogg_sync_init(&decoder->private_->ogg.sync_state) != 0)
                return decoder->protected_->state = OggFLAC__STREAM_DECODER_OGG_ERROR;
 
-    FLAC__stream_decoder_set_read_callback(decoder->private_->FLAC_stream_decoder, read_callback_);
-    FLAC__stream_decoder_set_write_callback(decoder->private_->FLAC_stream_decoder, write_callback_);
-    FLAC__stream_decoder_set_metadata_callback(decoder->private_->FLAC_stream_decoder, metadata_callback_);
-    FLAC__stream_decoder_set_error_callback(decoder->private_->FLAC_stream_decoder, error_callback_);
-    FLAC__stream_decoder_set_client_data(decoder->private_->FLAC_stream_decoder, decoder);
+       FLAC__stream_decoder_set_read_callback(decoder->private_->FLAC_stream_decoder, read_callback_);
+       FLAC__stream_decoder_set_write_callback(decoder->private_->FLAC_stream_decoder, write_callback_);
+       FLAC__stream_decoder_set_metadata_callback(decoder->private_->FLAC_stream_decoder, metadata_callback_);
+       FLAC__stream_decoder_set_error_callback(decoder->private_->FLAC_stream_decoder, error_callback_);
+       FLAC__stream_decoder_set_client_data(decoder->private_->FLAC_stream_decoder, decoder);
 
-    if(FLAC__stream_decoder_init(decoder->private_->FLAC_stream_decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
-        return decoder->protected_->state = OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR;
+       if(FLAC__stream_decoder_init(decoder->private_->FLAC_stream_decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
+               return decoder->protected_->state = OggFLAC__STREAM_DECODER_FLAC_STREAM_DECODER_ERROR;
 
        return decoder->protected_->state = OggFLAC__STREAM_DECODER_OK;
 }
@@ -448,7 +448,7 @@ FLAC__StreamDecoderReadStatus read_callback_(const FLAC__StreamDecoder *unused,
         * We have to be careful not to read in more than the
         * FLAC__StreamDecoder says it has room for.  We know
         * that the size of the decoded data must be no more
-        * than the encoded data we will read.  
+        * than the encoded data we will read.
         */
        ogg_bytes_to_read = min(*bytes, OGG_BYTES_CHUNK);
        oggbuf = ogg_sync_buffer(&decoder->private_->ogg.sync_state, ogg_bytes_to_read);
@@ -456,7 +456,7 @@ FLAC__StreamDecoderReadStatus read_callback_(const FLAC__StreamDecoder *unused,
        if(decoder->private_->read_callback(decoder, oggbuf, &ogg_bytes_to_read, decoder->private_->client_data) != FLAC__STREAM_DECODER_READ_STATUS_CONTINUE) {
                decoder->protected_->state = OggFLAC__STREAM_DECODER_READ_ERROR;
                return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
-       }   
+       }
        ogg_bytes_read = ogg_bytes_to_read;
 
        if(ogg_sync_wrote(&decoder->private_->ogg.sync_state, ogg_bytes_read) < 0) {
index d1ca547..f949ace 100644 (file)
@@ -126,7 +126,7 @@ void OggFLAC__stream_encoder_delete(OggFLAC__StreamEncoder *encoder)
        FLAC__ASSERT(0 != encoder->private_->FLAC_stream_encoder);
 
        (void)OggFLAC__stream_encoder_finish(encoder);
+
        FLAC__stream_encoder_delete(encoder->private_->FLAC_stream_encoder);
 
        free(encoder->private_);
index 5402a78..48876be 100644 (file)
@@ -61,27 +61,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = ::FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = ::FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = (::FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(::FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -90,16 +90,16 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = (FLAC__byte*)malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
@@ -142,7 +142,7 @@ static bool generate_file_()
        num_expected_ = 5;
 
        if(!file_utils__generate_flacfile(flacfilename_, &flacfilesize_, 512 * 1024, &streaminfo_, expected_metadata_sequence_, num_expected_))
-               return die_("creating the encoded file"); 
+               return die_("creating the encoded file");
 
        return true;
 }
@@ -169,21 +169,21 @@ public:
 
        if(feof(file_))
                return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-    else if(*bytes > 0) {
-        unsigned bytes_read = ::fread(buffer, 1, *bytes, file_);
-        if(bytes_read == 0) {
-            if(feof(file_))
-                return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-            else
-                return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-        else {
-            *bytes = bytes_read;
-            return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-    }
-    else
-        return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
+       else if(*bytes > 0) {
+               unsigned bytes_read = ::fread(buffer, 1, *bytes, file_);
+               if(bytes_read == 0) {
+                       if(feof(file_))
+                               return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+                       else
+                               return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+               else {
+                       *bytes = bytes_read;
+                       return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+       }
+       else
+               return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
 }
 
 ::FLAC__StreamDecoderWriteStatus DecoderCommon::common_write_callback_(const ::FLAC__Frame *frame)
@@ -191,13 +191,13 @@ public:
        if(error_occurred_)
                return ::FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
 
-    if(
-        (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
-        (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
-    ) {
-        printf("content... ");
-        fflush(stdout);
-    }
+       if(
+               (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
+               (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
+       ) {
+               printf("content... ");
+               fflush(stdout);
+       }
 
        return ::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
 }
index 7b87610..15183ca 100644 (file)
@@ -52,27 +52,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = ::FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = ::FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = (::FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(::FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -81,22 +81,22 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = (FLAC__byte*)malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
-    vorbiscomment_.is_last = true;
-    vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
-    vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
+       vorbiscomment_.is_last = true;
+       vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
+       vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
        vorbiscomment_.data.vorbis_comment.vendor_string.length = 8;
        vorbiscomment_.data.vorbis_comment.vendor_string.entry = (FLAC__byte*)malloc_or_die_(8);
        memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, "flac 1.x", 8);
index c376084..2a0812b 100644 (file)
@@ -314,7 +314,7 @@ static bool generate_file_()
                return die_("priming our metadata");
 
        if(!file_utils__generate_flacfile(flacfile_, 0, 512 * 1024, &streaminfo, metadata, 1))
-               return die_("creating the encoded file"); 
+               return die_("creating the encoded file");
 
        free(vorbiscomment.data.vorbis_comment.vendor_string.entry);
 
@@ -363,7 +363,7 @@ static bool test_file_(const char *filename, bool ignore_metadata)
 static bool change_stats_(const char *filename, bool read_only)
 {
        if(!file_utils__change_stats(filename, read_only))
-        return die_("during file_utils__change_stats()");
+               return die_("during file_utils__change_stats()");
 
        return true;
 }
@@ -585,7 +585,7 @@ static bool test_level_1_()
 
        if(!test_file_(flacfile_, /*ignore_metadata=*/false))
                return false;
-       
+
        printf("SV[P]PP\tprev\n");
        if(!iterator.prev())
                return die_("iterator ended early\n");
index b92eb8a..b04343c 100644 (file)
@@ -42,27 +42,27 @@ static void *malloc_or_die_(size_t size)
 
 static void init_metadata_blocks_()
 {
-    streaminfo_.is_last = false;
-    streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = ::FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = ::FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = (::FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(::FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -71,16 +71,16 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application_.is_last = false;
-    application_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application_.length = 8;
+       application_.is_last = false;
+       application_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application_.length = 8;
        memcpy(application_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application_.data.application.data = (FLAC__byte*)malloc_or_die_(4);
        memcpy(application_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    vorbiscomment_.is_last = true;
-    vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
-    vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
+       vorbiscomment_.is_last = true;
+       vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
+       vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
        vorbiscomment_.data.vorbis_comment.vendor_string.length = 5;
        vorbiscomment_.data.vorbis_comment.vendor_string.entry = (FLAC__byte*)malloc_or_die_(5);
        memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, "name0", 8);
@@ -117,7 +117,7 @@ bool test_metadata_object_streaminfo()
        if(block.get_length() != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length());
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing StreamInfo::StreamInfo(const StreamInfo &)... +\n");
@@ -299,7 +299,7 @@ bool test_metadata_object_padding()
        if(block.get_length() != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length());
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing Padding::Padding(const Padding &)... +\n");
@@ -409,7 +409,7 @@ bool test_metadata_object_application()
        if(block.get_length() != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length());
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing Application::Application(const Application &)... +\n");
@@ -528,7 +528,7 @@ bool test_metadata_object_seektable()
        if(block.get_length() != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length());
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing SeekTable::SeekTable(const SeekTable &)... +\n");
@@ -790,7 +790,7 @@ bool test_metadata_object_vorbiscomment()
        if(block.get_length() != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length());
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing VorbisComment::VorbisComment(const VorbisComment &)... +\n");
index 8184246..1dce361 100644 (file)
@@ -125,27 +125,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -154,16 +154,16 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
@@ -206,7 +206,7 @@ static FLAC__bool generate_file_()
        num_expected_ = 5;
 
        if(!file_utils__generate_flacfile(flacfilename_, &flacfilesize_, 512 * 1024, &streaminfo_, expected_metadata_sequence_, num_expected_))
-               return die_("creating the encoded file"); 
+               return die_("creating the encoded file");
 
        return true;
 }
@@ -227,21 +227,21 @@ static FLAC__StreamDecoderReadStatus stream_decoder_read_callback_(const FLAC__S
 
        if(feof(dcd->file))
                return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-    else if(*bytes > 0) {
-        unsigned bytes_read = fread(buffer, 1, *bytes, dcd->file);
-        if(bytes_read == 0) {
-            if(feof(dcd->file))
-                return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-            else
-                return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-        else {
-            *bytes = bytes_read;
-            return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-    }
-    else
-        return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
+       else if(*bytes > 0) {
+               unsigned bytes_read = fread(buffer, 1, *bytes, dcd->file);
+               if(bytes_read == 0) {
+                       if(feof(dcd->file))
+                               return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+                       else
+                               return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+               else {
+                       *bytes = bytes_read;
+                       return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+       }
+       else
+               return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
 }
 
 static FLAC__StreamDecoderWriteStatus stream_decoder_write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
@@ -258,13 +258,13 @@ static FLAC__StreamDecoderWriteStatus stream_decoder_write_callback_(const FLAC_
        if(dcd->error_occurred)
                return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
 
-    if(
-        (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
-        (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
-    ) {
-        printf("content... ");
-        fflush(stdout);
-    }
+       if(
+               (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
+               (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
+       ) {
+               printf("content... ");
+               fflush(stdout);
+       }
 
        return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
 }
index 5721fd1..779e82d 100644 (file)
@@ -118,27 +118,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -147,22 +147,22 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
-    vorbiscomment_.is_last = true;
-    vorbiscomment_.type = FLAC__METADATA_TYPE_VORBIS_COMMENT;
-    vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
+       vorbiscomment_.is_last = true;
+       vorbiscomment_.type = FLAC__METADATA_TYPE_VORBIS_COMMENT;
+       vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
        vorbiscomment_.data.vorbis_comment.vendor_string.length = 8;
        vorbiscomment_.data.vorbis_comment.vendor_string.entry = malloc_or_die_(8);
        memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, "flac 1.x", 8);
index 2ef0eae..b998822 100644 (file)
@@ -319,7 +319,7 @@ static FLAC__bool generate_file_()
                return die_("priming our metadata");
 
        if(!file_utils__generate_flacfile(flacfile_, 0, 512 * 1024, &streaminfo, metadata, 1))
-               return die_("creating the encoded file"); 
+               return die_("creating the encoded file");
 
        free(vorbiscomment.data.vorbis_comment.vendor_string.entry);
 
@@ -377,7 +377,7 @@ static FLAC__bool test_file_(const char *filename, void (*metadata_callback)(con
 static FLAC__bool change_stats_(const char *filename, FLAC__bool read_only)
 {
        if(!file_utils__change_stats(filename, read_only))
-        return die_("during file_utils__change_stats()");
+               return die_("during file_utils__change_stats()");
 
        return true;
 }
@@ -592,7 +592,7 @@ static FLAC__bool test_level_1_()
 
        if(!test_file_(flacfile_, decoder_metadata_callback_compare_))
                return false;
-       
+
        printf("SV[P]PP\tprev\n");
        if(!FLAC__metadata_simple_iterator_prev(iterator))
                return die_("iterator ended early\n");
index 36468f9..34b77c1 100644 (file)
@@ -69,7 +69,7 @@ static FLAC__bool check_seektable_(const FLAC__StreamMetadata *block, unsigned n
        if(block->length != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length);
                return false;
-    }
+       }
        if(block->data.seek_table.num_points != num_points) {
                printf("FAILED, expected %u point, got %u\n", num_points, block->data.seek_table.num_points);
                return false;
@@ -93,14 +93,14 @@ static void entry_new_(FLAC__StreamMetadata_VorbisComment_Entry *entry, const ch
 {
        entry->length = strlen(field);
        entry->entry = (FLAC__byte*)malloc(entry->length);
-       FLAC__ASSERT(0 != entry->entry);        
+       FLAC__ASSERT(0 != entry->entry);
        memcpy(entry->entry, field, entry->length);
 }
 
 static void entry_clone_(FLAC__StreamMetadata_VorbisComment_Entry *entry)
 {
        FLAC__byte *x = (FLAC__byte*)malloc(entry->length);
-       FLAC__ASSERT(0 != x);   
+       FLAC__ASSERT(0 != x);
        memcpy(x, entry->entry, entry->length);
        entry->entry = x;
 }
@@ -206,7 +206,7 @@ FLAC__bool test_metadata_object()
        if(block->length != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length);
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing FLAC__metadata_object_clone()... ");
@@ -237,7 +237,7 @@ FLAC__bool test_metadata_object()
        if(block->length != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length);
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing FLAC__metadata_object_clone()... ");
@@ -268,7 +268,7 @@ FLAC__bool test_metadata_object()
        if(block->length != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length);
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing FLAC__metadata_object_clone()... ");
@@ -539,7 +539,7 @@ FLAC__bool test_metadata_object()
        if(!check_seektable_(block, seekpoints, seekpoint_array))
                return false;
 
-    {
+       {
                FLAC__uint64 nums[2] = { 3, 7 };
                seekpoint_array[seekpoints++].sample_number = nums[0];
                seekpoint_array[seekpoints++].sample_number = nums[1];
@@ -612,7 +612,7 @@ FLAC__bool test_metadata_object()
        if(block->length != expected_length) {
                printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length);
                return false;
-    }
+       }
        printf("OK\n");
 
        printf("testing FLAC__metadata_object_clone()... ");
index a691ab8..eadd581 100644 (file)
@@ -31,35 +31,35 @@ FLAC__bool compare_block_data_streaminfo_(const FLAC__StreamMetadata_StreamInfo
        if(blockcopy->min_blocksize != block->min_blocksize) {
                printf("FAILED, min_blocksize mismatch, expected %u, got %u\n", block->min_blocksize, blockcopy->min_blocksize);
                return false;
-    }
+       }
        if(blockcopy->max_blocksize != block->max_blocksize) {
                printf("FAILED, max_blocksize mismatch, expected %u, got %u\n", block->max_blocksize, blockcopy->max_blocksize);
                return false;
-    }
+       }
        if(blockcopy->min_framesize != block->min_framesize) {
                printf("FAILED, min_framesize mismatch, expected %u, got %u\n", block->min_framesize, blockcopy->min_framesize);
                return false;
-    }
+       }
        if(blockcopy->max_framesize != block->max_framesize) {
                printf("FAILED, max_framesize mismatch, expected %u, got %u\n", block->max_framesize, blockcopy->max_framesize);
                return false;
-    }
+       }
        if(blockcopy->sample_rate != block->sample_rate) {
                printf("FAILED, sample_rate mismatch, expected %u, got %u\n", block->sample_rate, blockcopy->sample_rate);
                return false;
-    }
+       }
        if(blockcopy->channels != block->channels) {
                printf("FAILED, channels mismatch, expected %u, got %u\n", block->channels, blockcopy->channels);
                return false;
-    }
+       }
        if(blockcopy->bits_per_sample != block->bits_per_sample) {
                printf("FAILED, bits_per_sample mismatch, expected %u, got %u\n", block->bits_per_sample, blockcopy->bits_per_sample);
                return false;
-    }
+       }
        if(blockcopy->total_samples != block->total_samples) {
                printf("FAILED, total_samples mismatch, expected %llu, got %llu\n", block->total_samples, blockcopy->total_samples);
                return false;
-    }
+       }
        if(0 != memcmp(blockcopy->md5sum, block->md5sum, sizeof(block->md5sum))) {
                printf("FAILED, md5sum mismatch, expected %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X, got %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\n",
                        (unsigned)block->md5sum[0],
@@ -96,7 +96,7 @@ FLAC__bool compare_block_data_streaminfo_(const FLAC__StreamMetadata_StreamInfo
                        (unsigned)blockcopy->md5sum[15]
                );
                return false;
-    }
+       }
        return true;
 }
 
@@ -125,7 +125,7 @@ FLAC__bool compare_block_data_application_(const FLAC__StreamMetadata_Applicatio
                        (unsigned)blockcopy->id[3]
                );
                return false;
-    }
+       }
        if(0 == block->data || 0 == blockcopy->data) {
                if(block->data != blockcopy->data) {
                        printf("FAILED, data mismatch (%s's data pointer is null)\n", 0==block->data?"original":"copy");
@@ -155,7 +155,7 @@ FLAC__bool compare_block_data_seektable_(const FLAC__StreamMetadata_SeekTable *b
        if(blockcopy->num_points != block->num_points) {
                printf("FAILED, num_points mismatch, expected %u, got %u\n", block->num_points, blockcopy->num_points);
                return false;
-    }
+       }
        for(i = 0; i < block->num_points; i++) {
                if(blockcopy->points[i].sample_number != block->points[i].sample_number) {
                        printf("FAILED, points[%u].sample_number mismatch, expected %llu, got %llu\n", i, block->points[i].sample_number, blockcopy->points[i].sample_number);
@@ -179,7 +179,7 @@ FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_VorbisCo
        if(blockcopy->vendor_string.length != block->vendor_string.length) {
                printf("FAILED, vendor_string.length mismatch, expected %u, got %u\n", block->vendor_string.length, blockcopy->vendor_string.length);
                return false;
-    }
+       }
        if(0 == block->vendor_string.entry || 0 == blockcopy->vendor_string.entry) {
                if(block->vendor_string.entry != blockcopy->vendor_string.entry) {
                        printf("FAILED, vendor_string.entry mismatch\n");
@@ -189,11 +189,11 @@ FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_VorbisCo
        else if(0 != memcmp(blockcopy->vendor_string.entry, block->vendor_string.entry, block->vendor_string.length)) {
                printf("FAILED, vendor_string.entry mismatch\n");
                return false;
-    }
+       }
        if(blockcopy->num_comments != block->num_comments) {
                printf("FAILED, num_comments mismatch, expected %u, got %u\n", block->num_comments, blockcopy->num_comments);
                return false;
-    }
+       }
        for(i = 0; i < block->num_comments; i++) {
                if(blockcopy->comments[i].length != block->comments[i].length) {
                        printf("FAILED, comments[%u].length mismatch, expected %u, got %u\n", i, block->comments[i].length, blockcopy->comments[i].length);
@@ -220,15 +220,15 @@ FLAC__bool compare_block_(const FLAC__StreamMetadata *block, const FLAC__StreamM
        if(blockcopy->type != block->type) {
                printf("FAILED, type mismatch, expected %s, got %s\n", FLAC__MetadataTypeString[block->type], FLAC__MetadataTypeString[blockcopy->type]);
                return false;
-    }
+       }
        if(blockcopy->is_last != block->is_last) {
                printf("FAILED, is_last mismatch, expected %u, got %u\n", (unsigned)block->is_last, (unsigned)blockcopy->is_last);
                return false;
-    }
+       }
        if(blockcopy->length != block->length) {
                printf("FAILED, length mismatch, expected %u, got %u\n", block->length, blockcopy->length);
                return false;
-    }
+       }
        switch(block->type) {
                case FLAC__METADATA_TYPE_STREAMINFO:
                        return compare_block_data_streaminfo_(&block->data.stream_info, &blockcopy->data.stream_info);
index 3bbc54b..a56fc25 100644 (file)
@@ -61,27 +61,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = ::FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = ::FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = (::FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(::FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -90,16 +90,16 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = (FLAC__byte*)malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
@@ -142,7 +142,7 @@ static bool generate_file_()
        num_expected_ = 5;
 
        if(!file_utils__generate_oggflacfile(oggflacfilename_, &oggflacfilesize_, 512 * 1024, &streaminfo_, expected_metadata_sequence_, num_expected_))
-               return die_("creating the encoded file"); 
+               return die_("creating the encoded file");
 
        return true;
 }
@@ -169,21 +169,21 @@ public:
 
        if(feof(file_))
                return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-    else if(*bytes > 0) {
-        unsigned bytes_read = ::fread(buffer, 1, *bytes, file_);
-        if(bytes_read == 0) {
-            if(feof(file_))
-                return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-            else
-                return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-        else {
-            *bytes = bytes_read;
-            return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-    }
-    else
-        return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
+       else if(*bytes > 0) {
+               unsigned bytes_read = ::fread(buffer, 1, *bytes, file_);
+               if(bytes_read == 0) {
+                       if(feof(file_))
+                               return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+                       else
+                               return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+               else {
+                       *bytes = bytes_read;
+                       return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+       }
+       else
+               return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
 }
 
 ::FLAC__StreamDecoderWriteStatus DecoderCommon::common_write_callback_(const ::FLAC__Frame *frame)
@@ -191,13 +191,13 @@ public:
        if(error_occurred_)
                return ::FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
 
-    if(
-        (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
-        (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
-    ) {
-        printf("content... ");
-        fflush(stdout);
-    }
+       if(
+               (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
+               (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
+       ) {
+               printf("content... ");
+               fflush(stdout);
+       }
 
        return ::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
 }
index 58172b5..f30941c 100644 (file)
@@ -51,27 +51,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = ::FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = ::FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = (::FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(::FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -80,22 +80,22 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = (FLAC__byte*)malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = ::FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
-    vorbiscomment_.is_last = true;
-    vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
-    vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
+       vorbiscomment_.is_last = true;
+       vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT;
+       vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
        vorbiscomment_.data.vorbis_comment.vendor_string.length = 8;
        vorbiscomment_.data.vorbis_comment.vendor_string.entry = (FLAC__byte*)malloc_or_die_(8);
        memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, "flac 1.x", 8);
index bba0c3a..2db275d 100644 (file)
@@ -84,27 +84,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -113,16 +113,16 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
@@ -134,7 +134,7 @@ static void init_metadata_blocks_()
                vorbiscomment_.data.vorbis_comment.vendor_string.length = vendor_string_length;
                vorbiscomment_.data.vorbis_comment.vendor_string.entry = malloc_or_die_(vendor_string_length);
                memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, FLAC__VENDOR_STRING, vendor_string_length);
-               vorbiscomment_.data.vorbis_comment.num_comments = 2;
+                       vorbiscomment_.data.vorbis_comment.num_comments = 2;
                vorbiscomment_.data.vorbis_comment.comments = malloc_or_die_(vorbiscomment_.data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry));
                vorbiscomment_.data.vorbis_comment.comments[0].length = 5;
                vorbiscomment_.data.vorbis_comment.comments[0].entry = malloc_or_die_(5);
@@ -165,7 +165,7 @@ static FLAC__bool generate_file_()
        num_expected_ = 5;
 
        if(!file_utils__generate_oggflacfile(oggflacfilename_, &oggflacfilesize_, 512 * 1024, &streaminfo_, expected_metadata_sequence_, num_expected_))
-               return die_("creating the encoded file"); 
+               return die_("creating the encoded file");
 
        return true;
 }
@@ -186,21 +186,21 @@ static FLAC__StreamDecoderReadStatus stream_decoder_read_callback_(const OggFLAC
 
        if(feof(dcd->file))
                return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-    else if(*bytes > 0) {
-        unsigned bytes_read = fread(buffer, 1, *bytes, dcd->file);
-        if(bytes_read == 0) {
-            if(feof(dcd->file))
-                return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
-            else
-                return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-        else {
-            *bytes = bytes_read;
-            return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-        }
-    }
-    else
-        return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
+       else if(*bytes > 0) {
+               unsigned bytes_read = fread(buffer, 1, *bytes, dcd->file);
+               if(bytes_read == 0) {
+                       if(feof(dcd->file))
+                               return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+                       else
+                               return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+               else {
+                       *bytes = bytes_read;
+                       return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+               }
+       }
+       else
+               return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */
 }
 
 static FLAC__StreamDecoderWriteStatus stream_decoder_write_callback_(const OggFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
@@ -217,13 +217,13 @@ static FLAC__StreamDecoderWriteStatus stream_decoder_write_callback_(const OggFL
        if(dcd->error_occurred)
                return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
 
-    if(
-        (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
-        (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
-    ) {
-        printf("content... ");
-        fflush(stdout);
-    }
+       if(
+               (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) ||
+               (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0)
+       ) {
+               printf("content... ");
+               fflush(stdout);
+       }
 
        return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
 }
index 547c870..8572829 100644 (file)
@@ -72,27 +72,27 @@ static void init_metadata_blocks_()
        */
 
        /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */
-    streaminfo_.is_last = false;
-    streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
-    streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
-    streaminfo_.data.stream_info.min_blocksize = 576;
-    streaminfo_.data.stream_info.max_blocksize = 576;
-    streaminfo_.data.stream_info.min_framesize = 0;
-    streaminfo_.data.stream_info.max_framesize = 0;
-    streaminfo_.data.stream_info.sample_rate = 44100;
-    streaminfo_.data.stream_info.channels = 1;
-    streaminfo_.data.stream_info.bits_per_sample = 8;
-    streaminfo_.data.stream_info.total_samples = 0;
+       streaminfo_.is_last = false;
+       streaminfo_.type = FLAC__METADATA_TYPE_STREAMINFO;
+       streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH;
+       streaminfo_.data.stream_info.min_blocksize = 576;
+       streaminfo_.data.stream_info.max_blocksize = 576;
+       streaminfo_.data.stream_info.min_framesize = 0;
+       streaminfo_.data.stream_info.max_framesize = 0;
+       streaminfo_.data.stream_info.sample_rate = 44100;
+       streaminfo_.data.stream_info.channels = 1;
+       streaminfo_.data.stream_info.bits_per_sample = 8;
+       streaminfo_.data.stream_info.total_samples = 0;
        memset(streaminfo_.data.stream_info.md5sum, 0, 16);
 
-    padding_.is_last = false;
-    padding_.type = FLAC__METADATA_TYPE_PADDING;
-    padding_.length = 1234;
+       padding_.is_last = false;
+       padding_.type = FLAC__METADATA_TYPE_PADDING;
+       padding_.length = 1234;
 
-    seektable_.is_last = false;
-    seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
+       seektable_.is_last = false;
+       seektable_.type = FLAC__METADATA_TYPE_SEEKTABLE;
        seektable_.data.seek_table.num_points = 2;
-    seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
+       seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH;
        seektable_.data.seek_table.points = malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint));
        seektable_.data.seek_table.points[0].sample_number = 0;
        seektable_.data.seek_table.points[0].stream_offset = 0;
@@ -101,22 +101,22 @@ static void init_metadata_blocks_()
        seektable_.data.seek_table.points[1].stream_offset = 1000;
        seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize;
 
-    application1_.is_last = false;
-    application1_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application1_.length = 8;
+       application1_.is_last = false;
+       application1_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application1_.length = 8;
        memcpy(application1_.data.application.id, "\xfe\xdc\xba\x98", 4);
        application1_.data.application.data = malloc_or_die_(4);
        memcpy(application1_.data.application.data, "\xf0\xe1\xd2\xc3", 4);
 
-    application2_.is_last = false;
-    application2_.type = FLAC__METADATA_TYPE_APPLICATION;
-    application2_.length = 4;
+       application2_.is_last = false;
+       application2_.type = FLAC__METADATA_TYPE_APPLICATION;
+       application2_.length = 4;
        memcpy(application2_.data.application.id, "\x76\x54\x32\x10", 4);
        application2_.data.application.data = 0;
 
-    vorbiscomment_.is_last = true;
-    vorbiscomment_.type = FLAC__METADATA_TYPE_VORBIS_COMMENT;
-    vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
+       vorbiscomment_.is_last = true;
+       vorbiscomment_.type = FLAC__METADATA_TYPE_VORBIS_COMMENT;
+       vorbiscomment_.length = (4 + 8) + 4 + (4 + 5) + (4 + 0);
        vorbiscomment_.data.vorbis_comment.vendor_string.length = 8;
        vorbiscomment_.data.vorbis_comment.vendor_string.entry = malloc_or_die_(8);
        memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, "flac 1.x", 8);
index c6367bb..2eebfe8 100644 (file)
@@ -31,35 +31,35 @@ FLAC__bool compare_block_data_streaminfo_(const FLAC__StreamMetadata_StreamInfo
        if(blockcopy->min_blocksize != block->min_blocksize) {
                printf("FAILED, min_blocksize mismatch, expected %u, got %u\n", block->min_blocksize, blockcopy->min_blocksize);
                return false;
-    }
+       }
        if(blockcopy->max_blocksize != block->max_blocksize) {
                printf("FAILED, max_blocksize mismatch, expected %u, got %u\n", block->max_blocksize, blockcopy->max_blocksize);
                return false;
-    }
+       }
        if(blockcopy->min_framesize != block->min_framesize) {
                printf("FAILED, min_framesize mismatch, expected %u, got %u\n", block->min_framesize, blockcopy->min_framesize);
                return false;
-    }
+       }
        if(blockcopy->max_framesize != block->max_framesize) {
                printf("FAILED, max_framesize mismatch, expected %u, got %u\n", block->max_framesize, blockcopy->max_framesize);
                return false;
-    }
+       }
        if(blockcopy->sample_rate != block->sample_rate) {
                printf("FAILED, sample_rate mismatch, expected %u, got %u\n", block->sample_rate, blockcopy->sample_rate);
                return false;
-    }
+       }
        if(blockcopy->channels != block->channels) {
                printf("FAILED, channels mismatch, expected %u, got %u\n", block->channels, blockcopy->channels);
                return false;
-    }
+       }
        if(blockcopy->bits_per_sample != block->bits_per_sample) {
                printf("FAILED, bits_per_sample mismatch, expected %u, got %u\n", block->bits_per_sample, blockcopy->bits_per_sample);
                return false;
-    }
+       }
        if(blockcopy->total_samples != block->total_samples) {
                printf("FAILED, total_samples mismatch, expected %llu, got %llu\n", block->total_samples, blockcopy->total_samples);
                return false;
-    }
+       }
        if(0 != memcmp(blockcopy->md5sum, block->md5sum, sizeof(block->md5sum))) {
                printf("FAILED, md5sum mismatch, expected %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X, got %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\n",
                        (unsigned)block->md5sum[0],
@@ -96,7 +96,7 @@ FLAC__bool compare_block_data_streaminfo_(const FLAC__StreamMetadata_StreamInfo
                        (unsigned)blockcopy->md5sum[15]
                );
                return false;
-    }
+       }
        return true;
 }
 
@@ -125,7 +125,7 @@ FLAC__bool compare_block_data_application_(const FLAC__StreamMetadata_Applicatio
                        (unsigned)blockcopy->id[3]
                );
                return false;
-    }
+       }
        if(0 == block->data || 0 == blockcopy->data) {
                if(block->data != blockcopy->data) {
                        printf("FAILED, data mismatch (%s's data pointer is null)\n", 0==block->data?"original":"copy");
@@ -155,7 +155,7 @@ FLAC__bool compare_block_data_seektable_(const FLAC__StreamMetadata_SeekTable *b
        if(blockcopy->num_points != block->num_points) {
                printf("FAILED, num_points mismatch, expected %u, got %u\n", block->num_points, blockcopy->num_points);
                return false;
-    }
+       }
        for(i = 0; i < block->num_points; i++) {
                if(blockcopy->points[i].sample_number != block->points[i].sample_number) {
                        printf("FAILED, points[%u].sample_number mismatch, expected %llu, got %llu\n", i, block->points[i].sample_number, blockcopy->points[i].sample_number);
@@ -179,7 +179,7 @@ FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_VorbisCo
        if(blockcopy->vendor_string.length != block->vendor_string.length) {
                printf("FAILED, vendor_string.length mismatch, expected %u, got %u\n", block->vendor_string.length, blockcopy->vendor_string.length);
                return false;
-    }
+       }
        if(0 == block->vendor_string.entry || 0 == blockcopy->vendor_string.entry) {
                if(block->vendor_string.entry != blockcopy->vendor_string.entry) {
                        printf("FAILED, vendor_string.entry mismatch\n");
@@ -189,11 +189,11 @@ FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_VorbisCo
        else if(0 != memcmp(blockcopy->vendor_string.entry, block->vendor_string.entry, block->vendor_string.length)) {
                printf("FAILED, vendor_string.entry mismatch\n");
                return false;
-    }
+       }
        if(blockcopy->num_comments != block->num_comments) {
                printf("FAILED, num_comments mismatch, expected %u, got %u\n", block->num_comments, blockcopy->num_comments);
                return false;
-    }
+       }
        for(i = 0; i < block->num_comments; i++) {
                if(blockcopy->comments[i].length != block->comments[i].length) {
                        printf("FAILED, comments[%u].length mismatch, expected %u, got %u\n", i, block->comments[i].length, blockcopy->comments[i].length);
@@ -220,15 +220,15 @@ FLAC__bool compare_block_(const FLAC__StreamMetadata *block, const FLAC__StreamM
        if(blockcopy->type != block->type) {
                printf("FAILED, type mismatch, expected %s, got %s\n", FLAC__MetadataTypeString[block->type], FLAC__MetadataTypeString[blockcopy->type]);
                return false;
-    }
+       }
        if(blockcopy->is_last != block->is_last) {
                printf("FAILED, is_last mismatch, expected %u, got %u\n", (unsigned)block->is_last, (unsigned)blockcopy->is_last);
                return false;
-    }
+       }
        if(blockcopy->length != block->length) {
                printf("FAILED, length mismatch, expected %u, got %u\n", block->length, blockcopy->length);
                return false;
-    }
+       }
        switch(block->type) {
                case FLAC__METADATA_TYPE_STREAMINFO:
                        return compare_block_data_streaminfo_(&block->data.stream_info, &blockcopy->data.stream_info);
index 6edacd2..fdf7de6 100755 (executable)
@@ -4,12 +4,12 @@
 # This isn't always true (for example, nasm can't handle it)
 command=""
 while [ $1 ]; do
-    if [ "$1" != "-fPIC" ]; then
-        if [ "$1" != "-DPIC" ]; then
-            command="$command $1"
-        fi
-    fi
-    shift
+       if [ "$1" != "-fPIC" ]; then
+               if [ "$1" != "-DPIC" ]; then
+                       command="$command $1"
+               fi
+       fi
+       shift
 done
 echo $command
 exec $command