comparison libmpdemux/muxer_lavf.c @ 17834:d378f2f39537

in fix_parameters() move assignment of audio bitrate to the proper block (the bitrate for video is actually hardcoded to 800000)
author nicodvb
date Sun, 12 Mar 2006 19:05:57 +0000
parents b3ee00937967
children 27e97a75ef70
comparison
equal deleted inserted replaced
17833:b3ee00937967 17834:d378f2f39537
181 #if LIBAVFORMAT_BUILD >= 4629 181 #if LIBAVFORMAT_BUILD >= 4629
182 ctx = spriv->avstream->codec; 182 ctx = spriv->avstream->codec;
183 #else 183 #else
184 ctx = &(spriv->avstream->codec); 184 ctx = &(spriv->avstream->codec);
185 #endif 185 #endif
186
187 if(stream->wf && stream->wf->nAvgBytesPerSec)
188 ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
189 ctx->rc_buffer_size= stream->vbv_size; 186 ctx->rc_buffer_size= stream->vbv_size;
190 ctx->rc_max_rate= stream->max_rate; 187 ctx->rc_max_rate= stream->max_rate;
191 188
192 if(stream->type == MUXER_TYPE_AUDIO) 189 if(stream->type == MUXER_TYPE_AUDIO)
193 { 190 {
196 ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag); 193 ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag);
197 #if 0 //breaks aac in mov at least 194 #if 0 //breaks aac in mov at least
198 ctx->codec_tag = codec_get_wav_tag(ctx->codec_id); 195 ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);
199 #endif 196 #endif
200 mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO CODEC ID: %x, TAG: %x\n", ctx->codec_id, (uint32_t) ctx->codec_tag); 197 mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO CODEC ID: %x, TAG: %x\n", ctx->codec_id, (uint32_t) ctx->codec_tag);
198 if(stream->wf->nAvgBytesPerSec)
199 ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
201 ctx->sample_rate = stream->wf->nSamplesPerSec; 200 ctx->sample_rate = stream->wf->nSamplesPerSec;
202 // mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize); 201 // mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize);
203 ctx->channels = stream->wf->nChannels; 202 ctx->channels = stream->wf->nChannels;
204 if(stream->h.dwRate && (stream->h.dwScale * (int64_t)ctx->sample_rate) % stream->h.dwRate == 0) 203 if(stream->h.dwRate && (stream->h.dwScale * (int64_t)ctx->sample_rate) % stream->h.dwRate == 0)
205 ctx->frame_size= (stream->h.dwScale * (int64_t)ctx->sample_rate) / stream->h.dwRate; 204 ctx->frame_size= (stream->h.dwScale * (int64_t)ctx->sample_rate) / stream->h.dwRate;