From 78e035162c471ba78af4bcc348a967197c62fa17 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 4 Sep 2005 09:00:47 +0000 Subject: [PATCH] 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 --- ffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index 4c35671da0..a611120000 100644 --- a/ffmpeg.c +++ b/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);