Commit e2a0c479 authored by pross's avatar pross

Display error message when user attempts to resample non-S16 audio formats....

Display error message when user attempts to resample non-S16 audio formats. Patch supplied by Daniel Serpell <daniel dot serpell at gmail dotcom>


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15119 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent df496edf
...@@ -537,6 +537,10 @@ static void do_audio_out(AVFormatContext *s, ...@@ -537,6 +537,10 @@ static void do_audio_out(AVFormatContext *s,
ost->audio_resample = 1; ost->audio_resample = 1;
if (ost->audio_resample && !ost->resample) { if (ost->audio_resample && !ost->resample) {
if (dec->sample_fmt != SAMPLE_FMT_S16) {
fprintf(stderr, "Audio resampler only works with 16 bits per sample, patch welcome.\n");
av_exit(1);
}
ost->resample = audio_resample_init(enc->channels, dec->channels, ost->resample = audio_resample_init(enc->channels, dec->channels,
enc->sample_rate, dec->sample_rate); enc->sample_rate, dec->sample_rate);
if (!ost->resample) { if (!ost->resample) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment