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: http://spaceparanoids.org/downloads/mplayer-resume/
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.
November 19th, 2006 at 4:13 pm
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
unset($argv[0]);
-
- // 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);