Allow to disable mpg123 stderr output for recoverable MPEGs (FSBs)

This commit is contained in:
bnnm 2016-12-28 01:38:56 +01:00
parent ad3b081681
commit 790bb79cc9
2 changed files with 10 additions and 6 deletions

View File

@ -87,14 +87,11 @@ void decode_cbd2_int(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspac
void decode_ws(VGMSTREAM * vgmstream, int channel, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do);
#ifdef VGM_USE_MPEG
void decode_fake_mpeg2_l2(VGMSTREAMCHANNEL * stream,
mpeg_codec_data * data,
sample * outbuf, int32_t samples_to_do);
mpeg_codec_data *init_mpeg_codec_data(STREAMFILE *streamfile, off_t start_offset, long given_sample_rate, int given_channels, coding_t *coding_type, int * actual_sample_rate, int * actual_channels);
void decode_fake_mpeg2_l2(VGMSTREAMCHANNEL * stream, mpeg_codec_data * data, sample * outbuf, int32_t samples_to_do);
void decode_mpeg(VGMSTREAMCHANNEL * stream, mpeg_codec_data * data, sample * outbuf, int32_t samples_to_do, int channels);
long mpeg_bytes_to_samples(long bytes, const struct mpg123_frameinfo *mi);
void decode_mpeg(VGMSTREAMCHANNEL * stream,
mpeg_codec_data * data,
sample * outbuf, int32_t samples_to_do, int channels);
void mpeg_set_error_logging(mpeg_codec_data * data, int enable);
#endif
#ifdef VGM_USE_G7221

View File

@ -226,4 +226,11 @@ long mpeg_bytes_to_samples(long bytes, const struct mpg123_frameinfo *mi) {
return (int64_t)bytes * mi->rate * 8 / (mi->bitrate * 1000);
}
/**
* disables/enables stderr output, useful for MPEG known to contain recoverable errors
*/
void mpeg_set_error_logging(mpeg_codec_data * data, int enable) {
mpg123_param(data->m, MPG123_ADD_FLAGS, MPG123_QUIET, !enable);
}
#endif