[MPlayer-dev-eng] MPlayer/MEncoder crash on using -vf scale and expand together. Fix attached.

Ivan Kalvachev ikalvachev at gmail.com
Sun Oct 30 23:11:28 CET 2011


On 10/29/11, Alex C. <alexc.xander at yahoo.in> wrote:
> On Sat, 2011-10-29 at 17:59 +0300, Ivan Kalvachev wrote:
>> I don't hear any objections, so in few hours I'll commit it with the
>> following message:
>> ------------------------
>> Ensure aligned stride for vf_scale output temp buffer.
>>
>> The MP_IMGFLAG_PREFER_ALIDNED_STRIDE is honored only
>> with MP_IMGTYPE_EXPORT, but vf_scale uses only MP_IMGTYPE_TEMP.
>> As result stride won't be rounded up to a multiple of 16.
>>
>> Use MP_IMGFLAG_ACCEPT_ALIDNED_STRIDE instead, as it works for
>> all memory allocated image types..
>>
>> Discovery and initial patch by alexc.xander.yahoo.in.
>> Workarounds segfault in swscale sse3 code due to unaligned access.
>
> Are you sure that shouldn't be MP_IMGFLAG_ACCEPT_ALIGNED? (D->G) :-)

MPlayer already uses av_malloc that is using memaligned internally.
So the image planes are always allocated aligned.

>
> Seriously,  though, it  would  be better  to  replace libswscale  with
> another, cleaner,  scaling engine, even  if a little  slower. Possible
> alternatives  would include  y4mscale and  AVISynth scaling,  and I've
> also heard good things about DScaler. Maybe we can cherry-pick those.

I suspend this and mine patch.
I think I found mistake in my logic. The current flags should work for
all types that are numerically bigger than EXPORT_, aka are not
exported. So the reason for not aligning the stride may be exactly the
reason you pointed out, using of vo that doesn't accept stride.


More information about the MPlayer-dev-eng mailing list