1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

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

View File

@ -103,17 +103,16 @@ static URLProtocol mp_protocol = {
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_priv_t *spriv;
AVCodecContext *ctx;
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;
}
priv = muxer->priv;
stream = calloc(1, sizeof(muxer_stream_t));
if(!stream)
@ -183,20 +182,19 @@ static void fix_parameters(muxer_stream_t *stream)
#else
ctx = &(spriv->avstream->codec);
#endif
if(stream->wf && stream->wf->nAvgBytesPerSec)
ctx->bit_rate = stream->wf->nAvgBytesPerSec * 8;
ctx->rc_buffer_size= stream->vbv_size;
ctx->rc_max_rate= stream->max_rate;
if(stream->type == MUXER_TYPE_AUDIO)
{
if(!stream->wf)
return;
ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag);
#if 0 //breaks aac in mov at least
ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);
#endif
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;
// mp_msg(MSGT_MUXER, MSGL_INFO, "stream->h.dwSampleSize: %d\n", stream->h.dwSampleSize);
ctx->channels = stream->wf->nChannels;
@ -221,8 +219,6 @@ static void fix_parameters(muxer_stream_t *stream)
}
else if(stream->type == MUXER_TYPE_VIDEO)
{
if(!stream->bih)
return;
ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression);
if(ctx->codec_id <= 0)
ctx->codec_tag= stream->bih->biCompression;