Opened 3 years ago

Last modified 3 years ago

#2383 new defect

mplayer only uses 1/4 of window for video on MacOS 12.2.1

Reported by: alex Owned by: beastd
Priority: normal Component: undetermined
Version: unspecified Severity: critical
Keywords: Cc: alex
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description (last modified by alex)

Summary of the bug:

When playing a video with version 1.5-13.0.0 on MacOS 12.2.1 only a fourth of the actual video is shown. 3/4 of the mplayer window is black:

https://i.stack.imgur.com/EUvYo.jpg

This seems to be the case for any video file (mkv, mp4, ...).
This also happens for a new user on the Mac.

Change History (13)

comment:1 by alex, 3 years ago

Description: modified (diff)

comment:2 by reimar, 3 years ago

This should be fixed in 1.5, are you absolutely sure it is 1.5 or newer you are running?
Also which vo is this using (provide a log file if you don't know).
Lastly, this should not depend on OS version, it should depend on whether you are using a retina display or not.

comment:3 by alex, 3 years ago

Here is the command line output when playing a video file showing just 1/4 of the screen:

$ mplayer  test.mkv 
MPlayer 1.5-13.0.0 (C) 2000-2022 MPlayer Team
Can't init Apple Remote.

Playing test.mkv.
libavformat version 59.17.102 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (ac3), -aid 0, -alang eng
[lavf] stream 2: subtitle (srt), -sid 0, -slang eng, English
VIDEO:  [H264]  720x480  0bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 59.21.100 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Clip info:
 encoder: libebml v1.0.0 + libmatroska v1.0.0
 creation_time: 2010-08-29T20:12:47.000000Z
Load subtitles in ./
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[ac3 @ 0x105c02f70]Channel layout '5.1(side)' with 6 channels does not match specified number of channels 2: ignoring specified channel layout
AUDIO: 48000 Hz, 2 ch, floatle, 448.0 kbit/14.58% (ratio: 56000->384000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [coreaudio] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [gl_nosw] 720x480 => 720x542 Planar YV12 
Fontconfig warning: ignoring UTF-8: not a valid region tag
A:   3.4 V:   3.4 A-V:  0.003 ct:  0.001   0/  0  6% 13%  0.8% 14 0 

comment:4 by reimar, 3 years ago

I definitely can't reproduce. Running 12.2.1 on an M1 MacBook Air.
Does anything change if you switch to fullscreen? To fullscreen and back?
Any other ideas why it might work for me and not for you?
Have you/can you try latest SVN, just in case?
Could it be that your MPlayer version is compiled with a setting of macOS max version older than 10.7 (MAC_OS_X_VERSION_MAX_ALLOWED < 1070)?
Proper retina support is not possible if forcing compatibility with 10.6 or older, I'd say only PowerPC builds should do that.

comment:5 by alex, 3 years ago

When switching to fullscreen and back: The same. 1/4 of screen only shown.
Of course if could be compiled with some incorrect setting. How do I recompile mplayer from scratch?

comment:6 by reimar, 3 years ago

If you have a compiler installed, just
./configure && make
is enough, see also http://mplayerhq.hu/DOCS/HTML/en/features.html
But if I understand you right that you did not compile MPlayer yourself, it might be easier to tell me where you got it from and I can investigate?

comment:7 by alex, 3 years ago

I do not know how I created mplayer or how I did install it. I did not write it down. Can I find how that has been created? I just need a command line version...

Also, where do I have to do ./configure && make? I guess I have to download the source code somewhere. This does not seem to be described properly in the link you added. Maybe you can be VERY SPECIFIC and list EVERY SINGLE command? That would be useful!

comment:8 by reimar, 3 years ago

If you run
which mplayer
that would tell where it was installed, which might tell where you got it from.
More detailed compilation instructions are here, but not sure how great they are if you never did it (and as said on macOS you need to have XCode installed):
http://mplayerhq.hu/DOCS/README

Short version:
Download http://mplayerhq.hu/MPlayer/releases/MPlayer-1.5.tar.xz
extract with "tar xf MPlayer-1.5.tar.xz"
Go into MPlayer-1.5 directory
Then run the
./configure && make -j8
./mplayer
But as said there's a lot that can go wrong if you do it the first time...

comment:9 by alex, 3 years ago

Thanks a lot for the precise instructions!

With configure and make I was able to compile mplayer in that folder.
But when I use it with a video I get the exact same issue again: Only 1/4 of the mplayer window is filled with the video. 3/4 of mplayer's screen stays black. I am absolutely sure to use the newly compiled version...

Some output from the config step:

  Install prefix: /usr/local
  Data directory: /usr/local/share/mplayer
  Config direct.: /usr/local/etc/mplayer

  Byte order: little-endian
  Optimizing for: corei7-avx

  Languages:
    Messages/GUI: en
    Manual pages: en
    Documentation: en

  Enabled optional drivers:
    Input: ftp tv librtmp bluray vcd networking 
    Codecs: libaom libdav1d libvpx x264 xvid libopencore_amrwb libopencore_amrnb ffmpeg(internal) real xanim libopus faad2 faac libtheora speex libvorbis libmad liblzo OpenJPEG 
    Audio output: coreaudio openal sdl mpegpes(file) 
    Video output: matrixview opengl sdl pnm jpeg mng corevideo mpegpes(file) caca x11 xover yuv4mpeg md5sum tga 

  Disabled optional drivers:
    Input: dvdnav vstream pvr radio tv-v4l2 tv-v4l1 tv-dshow live555 nemesi cddb cdda dvdread dvb smb 
    Codecs: crystalhd libdv qtx win32 ilbc musepack libdca libmpeg2 liba52 mpg123 libgsm toolame twolame gif 
    Audio output: sndio sun alsa jack pulse nas esd arts oss v4l2 dxr2 
    Video output: zr zr2 v4l2 dxr3 dxr2 vesa gif89a quartz fbdev svga aa ggi xvidix winvidix cvidix 3dfx xmga dga vdpau xvmc xv directfb dfbmga bl xvr100 tdfx_vid wii s3fb tdfxfb mga 

'config.h' and 'config.mak' contain your configuration options.
Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
      compile *** DO NOT REPORT BUGS if you tweak these files ***

'make' will now compile MPlayer and 'make install' will install it.
Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.

Please check MTRR settings at /proc/mtrr (see DOCS/HTML/en/video.html#mtrr)

NOTE: Win32 codec DLLs are not supported on your CPU (x86_64) or your
operating system (Darwin). You may encounter a few files that cannot
be played due to missing open source video/audio codec support.

Check config.log if you wonder why an autodetection failed (make sure
development headers/packages are installed).

NOTE: The --enable-* parameters unconditionally force options on, completely
skipping autodetection. This behavior is unlike what you may be used to from
autoconf-based configure scripts that can decide to override you. This greater
level of control comes at a price. You may have to provide the correct compiler
and linker flags yourself.
If you used one of these options (except --enable-menu and similar ones that
turn on internal features) and experience a compilation or linking failure,
make sure you have passed the necessary compiler/linker flags to configure.

If you suspect a bug, please read DOCS/HTML/en/bugreports.html.

Last edited 3 years ago by alex (previous) (diff)

comment:10 by reimar, 3 years ago

Maybe that is something specific to Intel Macs? Can't test it then.
You could try applying below patch.
If you don't know how to apply a patch, you can do the changes manually.
Open the file libvo/osx_objc_common.m , delete all lines with
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
also the corresponding #endif that is a few lines later for each.
(in the patch I also removed the "if" lines with respondsToSelector but that should not be necessary really)

Index: libvo/osx_objc_common.m
===================================================================
--- libvo/osx_objc_common.m (revision 38361)
+++ libvo/osx_objc_common.m (working copy)
@@ -142,10 +142,7 @@

NSScreen *screen_handle = [self fullscreen_screen];
NSRect screen_frame = [screen_handle frame];
NSSize size = screen_frame.size;

-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070

  • if ([self respondsToSelector:@selector(convertSizeToBacking:)])

size = [self convertSizeToBacking:size];

-#endif

vo_screenwidth = size.width;
vo_screenheight = size.height;
xinerama_x = screen_frame.origin.x;

@@ -225,10 +222,7 @@

Also flip vo_dy since the screen origin is in the bottom left on OSX.
[self update_screen_info];
NSPoint topleft = NSMakePoint(vo_dx, 2*xinerama_y + vo_screenheight - vo_dy);

-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070

  • if ([self respondsToSelector:@selector(convertPointFromBacking:)])

topleft = [self convertPointFromBacking:topleft];

-#endif

[window setFrameTopLeftPoint:topleft];


vo_fs = flags & VOFLAG_FULLSCREEN;

@@ -255,10 +249,7 @@

[super reshape];
NSRect frame = [self frame];
NSSize size = frame.size;

-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070

  • if ([self respondsToSelector:@selector(convertSizeToBacking:)])

size = [self convertSizeToBacking:size];

-#endif

vo_dwidth = size.width;
vo_dheight = size.height;
event_flags |= VO_EVENT_RESIZE;

@@ -415,10 +406,7 @@

[self update_screen_info];


NSSize size = { vo_screenwidth, vo_screenheight };

-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070

  • if ([self respondsToSelector:@selector(convertSizeFromBacking:)])

size = [self convertSizeFromBacking:size];

-#endif

[window setFrame:NSMakeRect(xinerama_x, xinerama_y, size.width, size.height) display:YES animate:animate]; zoom-in window with nice useless sfx
old_view_frame = [self bounds];


comment:11 by alex, 3 years ago

Thanks you so much, reimar,

this seem to have fixed the problem!

However, the if clause I had to remove were not

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070

but rather

#ifndef POWER

But if they were in the same placesI figured that are the clauses to remove.

I also checked it with different video formats, it all seems to work now!

Thanks a lot again!!

comment:12 by reimar, 3 years ago

Ok, that's real annoying/embarassing, it seems I forgot to merge the (last-minute) fix for that to the release branch (or maybe I didn't do it on purpose because it was last-minute).
Then the real problem is that the #ifndef is POWER which for some silly reason ends up defined on x86.

comment:13 by beastd, 3 years ago

Should we cherry pick the fix onto the 1.5 branch and make a new point release?

Note: See TracTickets for help on using tickets.