Prevent users from setting -vol and -acodec copy together.

They are incompatible since the frames are not decoded, so they can't be preprocessed.

Originally committed as revision 14178 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Ramiro Polla 2008-07-12 11:43:21 +00:00
parent f1b2f1bf50
commit d08e3e91af
1 changed files with 4 additions and 0 deletions

View File

@ -1686,6 +1686,10 @@ static int av_encode(AVFormatContext **output_files,
codec->time_base = ist->st->time_base; codec->time_base = ist->st->time_base;
switch(codec->codec_type) { switch(codec->codec_type) {
case CODEC_TYPE_AUDIO: case CODEC_TYPE_AUDIO:
if(audio_volume != 256) {
fprintf(stderr,"-acodec copy and -vol are incompatible (frames are not decoded)\n");
av_exit(1);
}
codec->sample_rate = icodec->sample_rate; codec->sample_rate = icodec->sample_rate;
codec->channels = icodec->channels; codec->channels = icodec->channels;
codec->frame_size = icodec->frame_size; codec->frame_size = icodec->frame_size;