libFLAC 1.3.1

This commit is contained in:
Grigory Chudov
2014-12-08 23:20:01 -05:00
parent 6201101ccf
commit 80615c01fe
1332 changed files with 24682 additions and 32111 deletions

View File

@@ -1,6 +1,6 @@
/* example_c_decode_file - Simple FLAC file decoder using libFLAC
* Copyright (C) 2007-2009 Josh Coalson
* Copyright (C) 2011-2013 Xiph.Org Foundation
* Copyright (C) 2011-2014 Xiph.Org Foundation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -22,10 +22,10 @@
* file. It only supports 16-bit stereo files.
*
* Complete API documentation can be found at:
* http://flac.sourceforge.net/api/
* http://xiph.org/flac/api/
*/
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -125,6 +125,18 @@ FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder
fprintf(stderr, "ERROR: this example only supports 16bit stereo streams\n");
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
if(frame->header.channels != 2) {
fprintf(stderr, "ERROR: This frame contains %d channels (should be 2)\n", frame->header.channels);
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
if(buffer [0] == NULL) {
fprintf(stderr, "ERROR: buffer [0] is NULL\n");
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
if(buffer [1] == NULL) {
fprintf(stderr, "ERROR: buffer [1] is NULL\n");
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
/* write WAVE header before we write the first frame */
if(frame->header.number.sample_number == 0) {