Sunday, April 19, 2009

MPlayer And Mkv Linked Chapters II

A few days ago I started playing with a patch which adds Matroska linked chapters support to MPlayer. I got the patch to work but there were a number of problems.

First, the patch did not apply cleanly but really two failed hunks out of forty is not bad all. I fixed the failed hunks quickly. The next problem was the build failed. The patched code was calling a function that had been removed about six months ago. I poked at this problem for a while, but eventually concluded that, since nothing actually replaced the missing function, I could just remove the call from the patched code. It was really just a wild guess but it worked! The patched code compiles cleanly now and playing a Matroska file with linked chapters proves the patch works.

But there a still problems and these will be much harder to figure out. The most obvious problem is the patch causes playback to loop forever, which is quite a strange side effect. A more subtle problem, is a timing glitch in the subtitles when the MPlayer switches between the main and linked file. The problem corrects quickly but it is noticeable.

Both of these problems will require a lot more digging, but if I'm going get that deeply into the MPlayer source, I may be better off looking at how this could done properly. In addition, the MPlayer developers have already rejected this patch so I really can't expect support from them, which will make the work much harder.

1 comment: