[MPlayer-dev-eng] [patch] malloc padding

Jindrich Makovicka makovick at kmlinux.fjfi.cvut.cz
Wed Dec 21 20:12:25 CET 2005


Ivan Kalvachev wrote:
> You are hurring too much...
> I would like to ask two things:
> 
> 1. If the problem is only in extradata why this patch messes with the
> demuxers? AFAI can see the extradata is copied in the v?_ffmpeg to the
> allocated&padded  buffer.

>From the comments in ffmpeg, the problem is _also_ in extradata. But
mainly avcodec_decode_video needs a padded buffer.

> 2. In case this align is needed for bitstream data too....
> then why the bug is not fixed in the ffmpeg instead of hacking random
> places in the players.

Sure, but I don't know much of lavc internals and don't know how big
impact it would have on speed. FFMPEG (libavformat) itself solves this
issue by allocating all the packets using av_new_packet.

I agree that this patch is a pretty dirty "solution", but it does not do
any harm and it can be reverted if ffmpeg could be properly fixed. I
just think about replacing this malloc+memset stuff by a single function
or macro, because on a second glance it's really ugly this way.

Regards,
-- 
Jindrich Makovicka




More information about the MPlayer-dev-eng mailing list