sizeof() is long, thus %d format in error message is wrong.

Fix by assigning extradata_size before and printing that, since
this also removes a bit of code duplication.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21828 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-01-05 15:41:00 +00:00
parent 9e1add871e
commit e3fe6113a6
1 changed files with 6 additions and 5 deletions

View File

@ -251,15 +251,16 @@ static void fix_parameters(muxer_stream_t *stream)
ctx->time_base.num = stream->h.dwScale;
if(stream->bih+1 && (stream->bih->biSize > sizeof(BITMAPINFOHEADER)))
{
ctx->extradata = av_malloc(stream->bih->biSize - sizeof(BITMAPINFOHEADER));
ctx->extradata_size = stream->bih->biSize - sizeof(BITMAPINFOHEADER);
ctx->extradata = av_malloc(ctx->extradata_size);
if(ctx->extradata != NULL)
{
ctx->extradata_size = stream->bih->biSize - sizeof(BITMAPINFOHEADER);
memcpy(ctx->extradata, stream->bih+1, ctx->extradata_size);
}
else
{
mp_msg(MSGT_MUXER, MSGL_ERR, "MUXER_LAVF(video stream) error! couldn't allocate %d bytes for extradata\n",
stream->bih->biSize - sizeof(BITMAPINFOHEADER));
ctx->extradata_size);
ctx->extradata_size = 0;
}
}
}
}