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

Filed under MPlayer

2 responses to “mplayer patch: -use-dir-conf option

  1. 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.

  2. non7top

    Thanks for this patch, I really like it. And I wonder if there ar any updates on your latest update?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s