MD5 comparison failures on decoding are now an error instead of a warning and will...
authorJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 7 Jul 2006 01:05:33 +0000 (01:05 +0000)
committerJosh Coalson <jcoalson@users.sourceforce.net>
Fri, 7 Jul 2006 01:05:33 +0000 (01:05 +0000)
doc/html/changelog.html
src/flac/decode.c

index 61d34d0..d465a93 100644 (file)
@@ -88,6 +88,7 @@
                                        <li>Added a new option <a href="documentation.html#flac_options_tag_from_file"><span class="argument">--tag-from-file</span></a> for setting a tag from file (e.g. for importing a cuesheet as a tag).</li>
                                        <li>Added support for encoding from non-compressed AIFF-C (<a href="https://sourceforge.net/tracker/?func=detail&amp;atid=113478&amp;aid=1090933&amp;group_id=13478">SF #1090933</a>).</li>
                                        <li>Importing of non-CDDA-compliant cuesheets now only issues a warning, not an error (see <a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=31282">here</a>).</li>
+                                       <li>MD5 comparison failures on decoding are now an error instead of a warning and will also return a non-zero exit code (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1493725&amp;group_id=13478&amp;atid=113478">SF #1493725</a>).</li>
                                        <li>Fixed a bug in cuesheet parsing where it would return an error if the last line of the cuesheet did not end with a newline.</li>
                                        <li>Fixed a bug that caused a crash when <span class="argument">-a</span> and <span class="argument">-t</span> were used together (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1229481&amp;group_id=13478&amp;atid=113478">SF #1229481</a>).</li>
                                        <li>Fixed a bug with --sector-align where appended samples were not always totally silent (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1237707&amp;group_id=13478&amp;atid=113478">SF #1237707</a>).</li>
index 89db407..59f7abf 100644 (file)
@@ -525,7 +525,7 @@ FLAC__bool DecoderSession_process(DecoderSession *d)
 
 int DecoderSession_finish_ok(DecoderSession *d)
 {
-       FLAC__bool md5_failure = false;
+       FLAC__bool ok = true, md5_failure = false;
 
 #ifdef FLAC__HAS_OGG
        if(d->is_ogg) {
@@ -547,7 +547,8 @@ int DecoderSession_finish_ok(DecoderSession *d)
        if(d->analysis_mode)
                flac__analyze_finish(d->aopts);
        if(md5_failure) {
-               flac__utils_printf(stderr, 1, "\r%s: WARNING, MD5 signature mismatch\n", d->inbasefilename);
+               flac__utils_printf(stderr, 1, "\r%s: ERROR, MD5 signature mismatch\n", d->inbasefilename);
+               ok = d->continue_through_decode_errors;
        }
        else if(!d->got_stream_info) {
                flac__utils_printf(stderr, 1, "\r%s: WARNING, cannot check MD5 signature since there was no STREAMINFO\n", d->inbasefilename);
@@ -555,11 +556,11 @@ int DecoderSession_finish_ok(DecoderSession *d)
        else {
                flac__utils_printf(stderr, 2, "\r%s: %s         \n", d->inbasefilename, d->test_only? "ok           ":d->analysis_mode?"done           ":"done");
        }
-       DecoderSession_destroy(d, /*error_occurred=*/false);
+       DecoderSession_destroy(d, /*error_occurred=*/!ok);
        if((d->is_wave_out || d->is_aiff_out) && (d->iff_headers_need_fixup || (!d->got_stream_info && strcmp(d->outfilename, "-"))))
                if(!fixup_iff_headers(d))
                        return 1;
-       return 0;
+       return ok? 0 : 1;
 }
 
 int DecoderSession_finish_error(DecoderSession *d)