[MPlayer-dev-eng] [PATCH] Remove all usage of memalign.

Erik Auerswald auerswal at unix-ag.uni-kl.de
Thu Jun 11 14:06:32 EEST 2020


Hi,

On 11.06.20 00:35, Reimar Döffinger wrote:
> Completely switch to av_malloc instead.
> The fallback for memalign has been plain malloc,
> which meant crashes on e.g. Win32 where malloc
> is not sufficiently aligned.
> ---
>   configure          |  4 ----
>   libmpdemux/video.c | 10 +++++-----
>   loader/win32.c     |  4 ++--
>   sub/sub.c          | 12 ++++++------
>   4 files changed, 13 insertions(+), 17 deletions(-)

I have tested this patch by building MPlayer and playing part of a
movie with subtitles, and did not see any problems.  This was on
GNU/Linux, so as far as I understand it, the patch should not result
in a noticable difference there, anyway.

I did not see any mistakes in the patch, but I do not know enough
about the MPlayer code to spot anything but obvious errors.

Grepping the sources, one instance of memalign seems to be left in
the file "libvo/vo_vesa.c":

     $ fgrep -lr --exclude '*.svn*' memalign
     ffmpeg/configure
     ffmpeg/libavutil/mem.o
     ffmpeg/libavutil/mem.c
     TOOLS/checktree.sh
     mencoder
     mplayer
     configure
     Changelog
     DOCS/tech/dr-methods.txt
     libvo/vo_vesa.c
     config.log

(I do not know if the VESA video output can be built and used on
Windows.)

I was curious about "TOOLS/checktree.sh".  As I understand it, there
is no need to remove "memalign" from there.  The tool does report
something, though:

     $ ./TOOLS/checktree.sh
     checking for spaces in filenames ...
     checking for uppercase extensions ...
     checking for MSDOS line endings ...
     ./vidix/dhahelperwin/common.ver
     ./vidix/dhahelperwin/ntverp.h

While this seems to pertain to Windows, the other files inside the
directory "vidix/dhahelperwin/" use UNIX line endings:

     $ file *
     common.ver:   C source, ASCII text, with CRLF line terminators
     dhahelper.c:  C source, ASCII text
     dhahelper.h:  C source, ASCII text
     dhahelper.rc: C source, ASCII text
     dhasetup.c:   C source, ASCII text
     NMAKEFILE:    ASCII text
     ntverp.h:     C source, ASCII text, with CRLF line terminators
     SOURCES:      ASCII text

(Just for the record, since I stumbled over this.)

HTH,
Erik


More information about the MPlayer-dev-eng mailing list