recommitted version 1.22 + Rich's 1.25

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17847 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-03-13 07:08:01 +00:00
parent 3067cc21c7
commit 619973d7b1
1 changed files with 5 additions and 9 deletions

View File

@ -103,17 +103,16 @@ static URLProtocol mp_protocol = {
static muxer_stream_t* lavf_new_stream(muxer_t *muxer, int type) static muxer_stream_t* lavf_new_stream(muxer_t *muxer, int type)
{ {
muxer_priv_t *priv; muxer_priv_t *priv = muxer->priv;
muxer_stream_t *stream; muxer_stream_t *stream;
muxer_stream_priv_t *spriv; muxer_stream_priv_t *spriv;
AVCodecContext *ctx; AVCodecContext *ctx;
if(!muxer || (type != MUXER_TYPE_VIDEO && type != MUXER_TYPE_AUDIO)) if(!muxer || (type != MUXER_TYPE_VIDEO && type != MUXER_TYPE_AUDIO))
{ {
mp_msg(MSGT_MUXER, MSGL_ERR, "NULL MUXER PASSED OR UNKNOW TYPE %d\n", type); mp_msg(MSGT_MUXER, MSGL_ERR, "UNKNOW TYPE %d\n", type);
return NULL; return NULL;
} }
priv = muxer->priv;
stream = calloc(1, sizeof(muxer_stream_t)); stream = calloc(1, sizeof(muxer_stream_t));
if(!stream) if(!stream)
@ -183,20 +182,19 @@ static void fix_parameters(muxer_stream_t *stream)
#else #else
ctx = &(spriv->avstream->codec); ctx = &(spriv->avstream->codec);
#endif #endif
if(stream->wf && stream->wf->nAvgBytesPerSec)
ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
ctx->rc_buffer_size= stream->vbv_size; ctx->rc_buffer_size= stream->vbv_size;
ctx->rc_max_rate= stream->max_rate; ctx->rc_max_rate= stream->max_rate;
if(stream->type == MUXER_TYPE_AUDIO) if(stream->type == MUXER_TYPE_AUDIO)
{ {
if(!stream->wf)
return;
ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag); ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag);
#if 0 //breaks aac in mov at least #if 0 //breaks aac in mov at least
ctx->codec_tag = codec_get_wav_tag(ctx->codec_id); ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);
#endif #endif
mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO CODEC ID: %x, TAG: %x\n", ctx->codec_id, (uint32_t) ctx->codec_tag); mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO CODEC ID: %x, TAG: %x\n", ctx->codec_id, (uint32_t) ctx->codec_tag);
if(stream->wf->nAvgBytesPerSec)
ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
ctx->sample_rate = stream->wf->nSamplesPerSec; ctx->sample_rate = stream->wf->nSamplesPerSec;
// mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize); // mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize);
ctx->channels = stream->wf->nChannels; ctx->channels = stream->wf->nChannels;
@ -221,8 +219,6 @@ static void fix_parameters(muxer_stream_t *stream)
} }
else if(stream->type == MUXER_TYPE_VIDEO) else if(stream->type == MUXER_TYPE_VIDEO)
{ {
if(!stream->bih)
return;
ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression); ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression);
if(ctx->codec_id <= 0) if(ctx->codec_id <= 0)
ctx->codec_tag= stream->bih->biCompression; ctx->codec_tag= stream->bih->biCompression;