mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 09:57:34 +00:00
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:
parent
9e1add871e
commit
e3fe6113a6
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user