comparison src/flac113/plugin.c @ 491:9fc8b269e811 trunk

[svn] flac 113 plugin: small fixes
author giacomo
date Sun, 21 Jan 2007 15:34:56 -0800
parents 5e375eca97da
children 31d21ad70903
comparison
equal deleted inserted replaced
490:be4cde738a73 491:9fc8b269e811
619 FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); 619 FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
620 620
621 if ( FLAC__stream_decoder_init_stream(decoder, read_callback_, seek_callback_, 621 if ( FLAC__stream_decoder_init_stream(decoder, read_callback_, seek_callback_,
622 tell_callback_, length_callback_, eof_callback_, write_callback_, metadata_callback_, 622 tell_callback_, length_callback_, eof_callback_, write_callback_, metadata_callback_,
623 error_callback_, /*client_data=*/&stream_data_) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) 623 error_callback_, /*client_data=*/&stream_data_) != FLAC__STREAM_DECODER_INIT_STATUS_OK )
624 {
625 vfs_fclose( stream_data_.vfsfile );
624 return false; 626 return false;
627 }
625 628
626 if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) 629 if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder))
630 {
631 vfs_fclose( stream_data_.vfsfile );
627 return false; 632 return false;
633 }
628 634
629 return true; 635 return true;
630 } 636 }
631 637
632 static void safe_decoder_finish_(FLAC__StreamDecoder *decoder) 638 static void safe_decoder_finish_(FLAC__StreamDecoder *decoder)
761 static FLAC__StreamDecoderSeekStatus seek_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) 767 static FLAC__StreamDecoderSeekStatus seek_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
762 { 768 {
763 stream_data_struct *stream_data = (stream_data_struct *)client_data; 769 stream_data_struct *stream_data = (stream_data_struct *)client_data;
764 (void)decoder; 770 (void)decoder;
765 771
766 g_print("SEEK\n");
767
768 if ( vfs_fseek( stream_data->vfsfile , (glong)absolute_byte_offset , SEEK_SET ) < 0 ) 772 if ( vfs_fseek( stream_data->vfsfile , (glong)absolute_byte_offset , SEEK_SET ) < 0 )
769 return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; 773 return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
770 else 774 else
771 return FLAC__STREAM_DECODER_SEEK_STATUS_OK; 775 return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
772 } 776 }