u8sand / Baka-MPlayer

The libmpv based media player
https://u8sand.github.io/Baka-MPlayer/
GNU General Public License v2.0
433 stars 93 forks source link

Playing audio without embedded album art causes player to crash #192

Closed Chromace closed 8 years ago

Chromace commented 8 years ago

The attached zip contains two audio files with only one difference between them: one has embedded album art (via a music tagger). Opening the one without the album art in Baka-MPlayer causes it to crash. Opening it in mpv causes no problems - it plays with a blank screen.

Sample Music.zip

godly-devotion commented 8 years ago

The one without the album art causes it to crash? That's very odd. Also what OS are you using?

Chromace commented 8 years ago

@godly-devotion Correct. The one without album art causes it to crash. And I am using Arch Linux

u8sand commented 8 years ago

@Chromace It interestingly doesn't crash on my system (I also use ArchLinux). Regardless the culprit is most likely our overlay handler. Overlay handler uses mpv's add-overlay system to overlay the video through mpv. It's really messy and a bad way to do it but it was the only way at the time; now we can obtain an opengl device context from mpv and overlay it in a normal way.

This is part of an ongoing refactoring project that has slowed down significantly recently due to my workload outside of this project.

Chromace commented 8 years ago

@u8sand Thanks. I know a little more now (always good).

Why might Baka be fine playing audio with album art, but not without?

u8sand commented 8 years ago

Largely has to do with the overlayhandler. When there is album art, we write to a virtual image and then we pass that image on to mpv to display it, later on we take it out and delete the image (all very messy). When there is no album art, mpv doesn't do any displaying whatsoever, so we create our own image then we overlay it. If mpv reports that there is an image when their isn't it might crash, or if it said there wasn't an image when their is it might crash.

If you turn on mpv debugging while playing a video and watch the overlay-add and deletes, you'll see why it is prone to crashing for this and for things like holding the tab key causing it to delete and undelete very fast. We use thread locking techniques but we have no control over the thread safety of mpv itself.

u8sand commented 8 years ago

As mentioned a few other issues, the best way to debug baka is getting its own outputted debugging information (put on stdout). You'd have to compile from master--(as you're on archlinux this would be from AUR: baka-mplayer-git).

Chromace commented 8 years ago

@u8sand Using the master build, Baka MPlayer appears to be playing audio without embedded album art fine. Instead of crashing, a placeholder image is displayed. In fact, the regular community repository version of Baka also handles this audio fine, displaying the same placeholder image.

without album art

I wonder what happened...?

u8sand commented 8 years ago

@Chromace Yes, it is indeed strange. Someone else is having the issue https://github.com/u8sand/Baka-MPlayer/issues/200 though. We've tried a lot of things to little avail. I'll close this issue, any further developments can be mentioned in the other issue.

I'm glad it's working for you :+1: