# HG changeset patch # User ertzing # Date 1177077104 25200 # Node ID 1f78881a5f3ce0acc9ae794395853b70c2bc82ca # Parent f1642ee1115cbad94e735d3d2b8714b812748130 [svn] - Make flacng use vfs_fsize() diff -r f1642ee1115c -r 1f78881a5f3c ChangeLog --- a/ChangeLog Fri Apr 20 06:50:15 2007 -0700 +++ b/ChangeLog Fri Apr 20 06:51:44 2007 -0700 @@ -1,3 +1,16 @@ +2007-04-20 13:50:15 +0000 Ralf Ertzinger + revision [2070] + + - Implement vfs_fsize() for stdio + - Implement dummys for curl/mms/smb + + trunk/src/curl/curl.c | 8 ++++++++ + trunk/src/mms/mms.c | 9 ++++++++- + trunk/src/smb/smb.c | 9 ++++++++- + trunk/src/stdio/stdio.c | 23 +++++++++++++++++++++-- + 4 files changed, 45 insertions(+), 4 deletions(-) + + 2007-04-18 14:38:58 +0000 Tony Vroon revision [2068] Sync with upstream. Subsong improvements for ADL, new JBM player. diff -r f1642ee1115c -r 1f78881a5f3c src/flacng/seekable_stream_callbacks.c --- a/src/flacng/seekable_stream_callbacks.c Fri Apr 20 06:50:15 2007 -0700 +++ b/src/flacng/seekable_stream_callbacks.c Fri Apr 20 06:51:44 2007 -0700 @@ -148,35 +148,26 @@ FLAC__StreamDecoderLengthStatus length_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) { callback_info* info; - size_t size; - glong position; + off_t size; _ENTER; info = (callback_info*) client_data; _DEBUG("Using callback_info %s", info->name); - if (-1 == (position = vfs_ftell(info->input_stream))) { - _ERROR("Could not tell current position!"); - _LEAVE FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - } - - if (-1 == vfs_fseek(info->input_stream, 0, SEEK_END)) { - _ERROR("Could not seek to end of stream."); - _LEAVE FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; + if (-1 == (size = vfs_fsize(info->input_stream))) { + /* + * Could not get the stream size. This is not necessarily an + * error, maybe the stream has no fixed size (think streaming + * audio) + */ + _DEBUG("Stream length unknown"); + *stream_length = 0; + _LEAVE FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; } - if (-1 == (*stream_length = vfs_ftell(info->input_stream))) { - _ERROR("Could not tell position at end of stream!"); - _LEAVE FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - } - - if (-1 == vfs_fseek(info->input_stream, position, SEEK_SET)) { - _ERROR("Could not reset stream position. We're probably in trouble now."); - _LEAVE FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - } - - _DEBUG("Stream length is %d bytes", *stream_length); + _DEBUG("Stream length is %d bytes", size); + *stream_length = size; _LEAVE FLAC__STREAM_DECODER_LENGTH_STATUS_OK; } @@ -187,7 +178,6 @@ glong i; gshort j; - gint32 sample; callback_info* info; _ENTER;