[MPlayer-dev-eng] v4l/v4l2 buffer size bug

Ivan Kalvachev ikalvachev at gmail.com
Tue Apr 25 09:02:24 CEST 2006


2006/4/25, Alan Curry <pacman at theworld.com>:
> This code in tvi_v4l.c and tvi_v4l2.c:
>
>         sysinfo(&si);
>         if (si.totalram<2*1024*1024) {
>             bufsize = 1024*1024;
>         } else {
>             bufsize = si.totalram/2;
>         }
>
> doesn't work correctly when si.mem_unit!=1 which will be the case whenever
> any element of the sysinfo is bigger than 4G. The fix would be to substitute
> si.totalram*si.mem_unit for si.totalram.
>
> mem_unit hasn't always been there. Detecting whether the running kernel
> supports mem_unit, and doing the right thing when <sys/sysinfo.h> contains
> the old struct definition without mem_unit, is left as an exercise for the
> v4l maintainer.

i don't see such person in docs/tech/maintainers.
You'd better do the exercise yourself and send patch before commit.

and yes, afair al3x wrote some of v4l(2) code and i'm sure he would
comment if there is something wrong in your code ;)




More information about the MPlayer-dev-eng mailing list