[MPlayer-dev-eng] Re: [MPlayer-users] ssa reader for mplayer using vf_overlay
Robert Henney
robh at rut.org
Sat Oct 1 23:28:09 CEST 2005
On Sat, Oct 01, 2005 at 10:08:05AM -0400, Jason Tackaberry wrote:
> On Sat, 2005-10-01 at 03:35 -0400, Robert Henney wrote:
> > UPDATE: did some further testing before sending this mail and
> > came up with a pattern. if the y value passed with the
> > invalidate command is ODD, then this strange color shift
> > always happens, but never when it's EVEN.
>
> Ah, yes, this does make sense. :) I'll add some code to vf_overlay
> which internally aligns the coordinates given to multiples of 2. I can
> reproduce the problem here.
in the meantime I'm just accounting for that in my code by clearing the
least significant bit of the y value I pass, and things are looking
good.
> > // 'mem' is pointer to overlay memory
> [...]
> > pW = (unsigned long*)mem + 4 + imagex + (y+imagey) * screenwidth;
>
> The BGRA buffer is offset 16 bytes from the shmem address, so it looks
> like you should be adding 16, rather than 4.
that's half the purpose of that cast there. longs on my system are 4
bytes, so since the cast takes precedence then any integer value applied
to it will affect the pointer in multples of 4 bytes. :)
the way I did it above though is not portable, and I should replace
it with this:
(unsigned long*)mem + 16/(sizeof long) + imagex ...
> Cheers,
> Jason.
--
robh
More information about the MPlayer-dev-eng
mailing list