Lines Matching refs:decoder
90 static FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder);
91 static void safe_decoder_finish_(FLAC__StreamDecoder *decoder);
92 static void safe_decoder_delete_(FLAC__StreamDecoder *decoder);
94 static FLAC__StreamDecoderReadStatus http_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
95 static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
96 static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
97 static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
542 FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder)
544 if(decoder == 0)
547 safe_decoder_finish_(decoder);
549 FLAC__stream_decoder_set_md5_checking(decoder, false);
550 FLAC__stream_decoder_set_metadata_ignore_all(decoder);
551 FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO);
552 FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
555 if(FLAC__stream_decoder_init_stream(decoder, http_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, write_callback_, metadata_callback_, error_callback_, /*client_data=*/&stream_data_) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
559 if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, /*client_data=*/&stream_data_) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
563 if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder))
569 void safe_decoder_finish_(FLAC__StreamDecoder *decoder)
571 if(decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED)
572 (void)FLAC__stream_decoder_finish(decoder);
577 void safe_decoder_delete_(FLAC__StreamDecoder *decoder)
579 if(decoder) {
580 safe_decoder_finish_(decoder);
581 FLAC__stream_decoder_delete(decoder);
585 FLAC__StreamDecoderReadStatus http_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
587 (void)decoder;
593 FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
600 (void)decoder;
653 void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
656 (void)decoder;
678 void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
681 (void)decoder;