mplayer patch: -use-dir-conf option

I just made a really small patch to MPlayer for something I’ve been wanting to do for a while. MPlayer has long supported a playback option -use-filedir-conf that will include a config file if you have it named <filename>.conf. I’ve taken that and just created an option for the current directory instead.

The issue I run into with my TV shows is that sometimes I need to use different deinterlacing filters or different audio delays for different series. It would be a pain to create a config file for each individual file, so this patch fits the bill. If you just use -use-dir-conf, it will look for an mplayer.conf file in the existing directory, and include that.

Pretty simple, really. I hope I wrote the patch right, since I’m no master of C. I just copied the old functionality, dropped what it didn’t look like was relevant and removed unused variables. And hey, works for me.

Patches cleanly against latest SVN (28348).

Edit: Well, crap, I just realized that it only works if you have mplayer.conf in the same directory as you are running mplayer from …. so doing mplayer -use-dir-conf /foo/movie.mp4 wouldn’t work if you’re not in /foo. Unlike -use-filedir-conf, you can’t call it from some other directory. Someone wanna help me out? 🙂

2 comments on “mplayer patch: -use-dir-conf option

  1. zaratustra

    Ola. I’m not mplayer hacker, but I would try to use string containing path of file to be played and remove part trailing last “/” (what is filename without path) and replace it with “mplayer.conf” string. You can use strtok to tokenize initial string.

    Reply

Leave a Reply to zaratustraCancel reply