the user sets codec->time_base for video encding so she should also set it for audio encoding

Originally committed as revision 4555 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 19 years ago
parent b983a5c608
commit 78e035162c
  1. 3
      ffmpeg.c

@ -1683,6 +1683,7 @@ static int av_encode(AVFormatContext **output_files,
codec->bit_rate = icodec->bit_rate;
codec->extradata= icodec->extradata;
codec->extradata_size= icodec->extradata_size;
codec->time_base = icodec->time_base;
switch(codec->codec_type) {
case CODEC_TYPE_AUDIO:
codec->sample_rate = icodec->sample_rate;
@ -1691,7 +1692,6 @@ static int av_encode(AVFormatContext **output_files,
codec->block_align= icodec->block_align;
break;
case CODEC_TYPE_VIDEO:
codec->time_base = icodec->time_base;
codec->width = icodec->width;
codec->height = icodec->height;
codec->has_b_frames = icodec->has_b_frames;
@ -3531,6 +3531,7 @@ static void new_audio_stream(AVFormatContext *oc)
audio_enc->channels = audio_channels;
}
audio_enc->sample_rate = audio_sample_rate;
audio_enc->time_base= (AVRational){1, audio_sample_rate};
if (audio_language) {
pstrcpy(st->language, sizeof(st->language), audio_language);
av_free(audio_language);

Loading…
Cancel
Save