# HG changeset patch # User ertzing # Date 1179345614 25200 # Node ID 7d7f77129c7520ec36437ba7621eb7b95cb37a4e # Parent 1b0890d5c00b1480a28cc6baff85cfe433430639 [svn] - Do not complain about errors in the stream while testing a file diff -r 1b0890d5c00b -r 7d7f77129c75 ChangeLog --- a/ChangeLog Wed May 16 04:10:36 2007 -0700 +++ b/ChangeLog Wed May 16 13:00:14 2007 -0700 @@ -1,3 +1,12 @@ +2007-05-16 11:10:36 +0000 Ralf Ertzinger + revision [2246] + + - Add filename to error message for unreadable metadata + + trunk/src/flacng/tools.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2007-05-15 20:45:38 +0000 Ralf Ertzinger revision [2242] diff -r 1b0890d5c00b -r 7d7f77129c75 src/flacng/flacng.h --- a/src/flacng/flacng.h Wed May 16 04:10:36 2007 -0700 +++ b/src/flacng/flacng.h Wed May 16 13:00:14 2007 -0700 @@ -88,6 +88,7 @@ gboolean metadata_changed; struct frame_info frame; glong read_max; + gboolean testing; gchar* name; } callback_info; diff -r 1b0890d5c00b -r 7d7f77129c75 src/flacng/seekable_stream_callbacks.c --- a/src/flacng/seekable_stream_callbacks.c Wed May 16 04:10:36 2007 -0700 +++ b/src/flacng/seekable_stream_callbacks.c Wed May 16 13:00:14 2007 -0700 @@ -231,9 +231,17 @@ void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) { + callback_info* info = (callback_info*) client_data; + _ENTER; - _ERROR("FLAC decoder error callback was called: %d", status); + _DEBUG("Using callback_info %s", info->name); + + if (!info->testing) { + _ERROR("FLAC decoder error callback was called: %d", status); + } else { + _DEBUG("FLAC decoder error callback was called: %d", status); + } _LEAVE; diff -r 1b0890d5c00b -r 7d7f77129c75 src/flacng/tools.c --- a/src/flacng/tools.c Wed May 16 04:10:36 2007 -0700 +++ b/src/flacng/tools.c Wed May 16 13:00:14 2007 -0700 @@ -94,6 +94,7 @@ info->buffer_used = 0; info->write_pointer = info->output_buffer; info->read_max = -1; + info->testing = FALSE; /* * Clear the stream and frame information @@ -278,6 +279,12 @@ info->read_max = 8192; /* + * We are not sure if this is an actual flac file, so do not + * complain too much about errors in the stream + */ + info->testing = TRUE; + + /* * Open the file */ if (NULL == (info->input_stream = vfs_fopen(filename, "rb"))) { @@ -300,6 +307,7 @@ */ info->read_max = -1; + info->testing = FALSE; _LEAVE TRUE; }