mplayer-resume 1.3

I just finished cleaning up a new version of mplayer-resume, my little wrapper script to mplayer to save / resume playback of media files. Woots.

You can download the new version from here:

Nothing too big that’s new here. I think the only major thing is that it reads your home directory using getenv() instead of you having to hardcode it. I have no idea why I didn’t do that in the first place. Plus I added support for a few more file extensions, and improved the documentation. That’s about it. Lemme know if you have any problems.🙂

Oh, and I fixed my subversion. Turns out that my config file didn’t have an entry for that Subversion directory I was pulling it from. I have no idea how in the world that happened. I still do have random times when I have to rebuild the entire group of packages though. This time, it was just pebkac. Oh well.


Filed under MPlayer

2 responses to “mplayer-resume 1.3

  1. Chojin

    This patch should fix the spaces-in-filename bug (also added extension .divx as I encountered it once):

    — mplayer-resume 2006-11-19 23:59:52.000000000 +0100
    +++ mplayer-resume-old 2006-09-16 04:20:05.000000000 +0200
    @@ -43,10 +43,7 @@

    // grep the filename to play
    // add more extensions if you like🙂
    – $movies = preg_grep(‘/\.(mk[av]|vob|mpeg|mp[34g]|og[gm]|avi|wav|midi?|wm[av]|mov|asf|yuv|ram?|aac|nuv|m4a|divx)$/i’, $argv);
    – $movie = end($movies);
    – // save arraykey where filename is in arguments array (PHP >= 4.0.3)
    – $movie_key = key($movies);
    + $movie = end(preg_grep(‘/\.(mk[av]|vob|mpeg|mp[34g]|og[gm]|avi|wav|midi?|wm[av]|mov|asf|yuv|ram?|aac|nuv|m4a)$/i’, $argv));

    // If we can’t get the movie name, just quit
    if(empty($movie)) {
    @@ -56,11 +53,6 @@

    // Drop the binary command

    – // quote filename to maintain spaces in filename
    – $escaped_filename = escapeshellarg($argv[$movie_key]);
    – // and remove filename from paramterlist
    – unset($argv[$movie_key]);

    // Put the arguments back together again
    $str_args = implode(‘ ‘, $argv);
    @@ -78,7 +70,7 @@

    // Build the execution string
    – $exec = escapeshellcmd(“mplayer $flags $str_args -quiet”).” $escaped_filename”;
    + $exec = escapeshellcmd(“mplayer $flags $str_args -quiet”);

    // Execute the command, save output to an array
    exec($exec, $arr);

  2. Tom

    I keep getting “No end position sent to save”

Leave a Reply

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

You are commenting using your 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