mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
enable file feof callback when input is stdin
This commit is contained in:
@@ -468,9 +468,9 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE(
|
|||||||
decoder,
|
decoder,
|
||||||
file_read_callback_,
|
file_read_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_seek_callback_,
|
decoder->private_->file == stdin? 0: file_seek_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_tell_callback_,/*@@@@@@ might work for stdin*/
|
decoder->private_->file == stdin? 0: file_tell_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_length_callback_,
|
decoder->private_->file == stdin? 0: file_length_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_eof_callback_,/*@@@@@@ might work for stdin*/
|
file_eof_callback_,
|
||||||
write_callback,
|
write_callback,
|
||||||
metadata_callback,
|
metadata_callback,
|
||||||
error_callback,
|
error_callback,
|
||||||
@@ -2916,7 +2916,7 @@ FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *dec
|
|||||||
off_t pos;
|
off_t pos;
|
||||||
(void)client_data;
|
(void)client_data;
|
||||||
|
|
||||||
if(decoder->private_->file == stdin) /*@@@@@@ may work for stdin */
|
if(decoder->private_->file == stdin)
|
||||||
return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
|
return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
|
||||||
else if((pos = ftello(decoder->private_->file)) < 0)
|
else if((pos = ftello(decoder->private_->file)) < 0)
|
||||||
return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
|
return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
|
||||||
@@ -2945,7 +2945,5 @@ FLAC__bool file_eof_callback_(const FLAC__StreamDecoder *decoder, void *client_d
|
|||||||
{
|
{
|
||||||
(void)client_data;
|
(void)client_data;
|
||||||
|
|
||||||
if(decoder->private_->file == stdin) /*@@@@@@ feof() may work for stdin */
|
|
||||||
return false;
|
|
||||||
return feof(decoder->private_->file)? true : false;
|
return feof(decoder->private_->file)? true : false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,9 +271,9 @@ OggFLAC_API FLAC__StreamDecoderInitStatus OggFLAC__stream_decoder_init_FILE(
|
|||||||
decoder,
|
decoder,
|
||||||
file_read_callback_,
|
file_read_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_seek_callback_,
|
decoder->private_->file == stdin? 0: file_seek_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_tell_callback_,/*@@@@@@ might work for stdin*/
|
decoder->private_->file == stdin? 0: file_tell_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_length_callback_,
|
decoder->private_->file == stdin? 0: file_length_callback_,
|
||||||
decoder->private_->file == stdin? 0: file_eof_callback_,/*@@@@@@ might work for stdin*/
|
file_eof_callback_,
|
||||||
write_callback,
|
write_callback,
|
||||||
metadata_callback,
|
metadata_callback,
|
||||||
error_callback,
|
error_callback,
|
||||||
@@ -1030,7 +1030,7 @@ FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *sup
|
|||||||
off_t pos;
|
off_t pos;
|
||||||
(void)client_data;
|
(void)client_data;
|
||||||
|
|
||||||
if(decoder->private_->file == stdin) /*@@@@@@ may work for stdin */
|
if(decoder->private_->file == stdin)
|
||||||
return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
|
return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
|
||||||
else if((pos = ftello(decoder->private_->file)) < 0)
|
else if((pos = ftello(decoder->private_->file)) < 0)
|
||||||
return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
|
return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
|
||||||
@@ -1061,7 +1061,5 @@ FLAC__bool file_eof_callback_(const FLAC__StreamDecoder *super, void *client_dat
|
|||||||
OggFLAC__StreamDecoder *decoder = (OggFLAC__StreamDecoder *)super;
|
OggFLAC__StreamDecoder *decoder = (OggFLAC__StreamDecoder *)super;
|
||||||
(void)client_data;
|
(void)client_data;
|
||||||
|
|
||||||
if(decoder->private_->file == stdin) /*@@@@@@ feof() may work for stdin */
|
|
||||||
return false;
|
|
||||||
return feof(decoder->private_->file)? true : false;
|
return feof(decoder->private_->file)? true : false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user