<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: mplayer-resume 1.3</title>
	<atom:link href="http://wonkabar.org/archives/172/feed" rel="self" type="application/rss+xml" />
	<link>http://wonkabar.org/archives/172</link>
	<description>linux, databases, cartoons and cornflakes</description>
	<pubDate>Tue, 06 Jan 2009 23:33:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Chojin</title>
		<link>http://wonkabar.org/archives/172#comment-1428</link>
		<dc:creator>Chojin</dc:creator>
		<pubDate>Sun, 19 Nov 2006 23:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://wonkabar.org/?p=172#comment-1428</guid>
		<description>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]&#124;vob&#124;mpeg&#124;mp[34g]&#124;og[gm]&#124;avi&#124;wav&#124;midi?&#124;wm[av]&#124;mov&#124;asf&#124;yuv&#124;ram?&#124;aac&#124;nuv&#124;m4a&#124;divx)$/i', $argv);
-       $movie = end($movies);
-       // save arraykey where filename is in arguments array (PHP &#62;= 4.0.3)
-       $movie_key = key($movies);
+       $movie = end(preg_grep('/\.(mk[av]&#124;vob&#124;mpeg&#124;mp[34g]&#124;og[gm]&#124;avi&#124;wav&#124;midi?&#124;wm[av]&#124;mov&#124;asf&#124;yuv&#124;ram?&#124;aac&#124;nuv&#124;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);</description>
		<content:encoded><![CDATA[<p>This patch should fix the spaces-in-filename bug (also added extension .divx as I encountered it once):</p>
<p>&#8212; mplayer-resume      2006-11-19 23:59:52.000000000 +0100<br />
+++ mplayer-resume-old  2006-09-16 04:20:05.000000000 +0200<br />
@@ -43,10 +43,7 @@</p>
<p>        // grep the filename to play<br />
        // add more extensions if you like <img src='http://wonkabar.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
-       $movies = preg_grep(&#8217;/\.(mk[av]|vob|mpeg|mp[34g]|og[gm]|avi|wav|midi?|wm[av]|mov|asf|yuv|ram?|aac|nuv|m4a|divx)$/i&#8217;, $argv);<br />
-       $movie = end($movies);<br />
-       // save arraykey where filename is in arguments array (PHP &gt;= 4.0.3)<br />
-       $movie_key = key($movies);<br />
+       $movie = end(preg_grep(&#8217;/\.(mk[av]|vob|mpeg|mp[34g]|og[gm]|avi|wav|midi?|wm[av]|mov|asf|yuv|ram?|aac|nuv|m4a)$/i&#8217;, $argv));</p>
<p>        // If we can&#8217;t get the movie name, just quit<br />
        if(empty($movie)) {<br />
@@ -56,11 +53,6 @@</p>
<p>        // Drop the binary command<br />
        unset($argv[0]);<br />
-<br />
-       // quote filename to maintain spaces in filename<br />
-       $escaped_filename = escapeshellarg($argv[$movie_key]);<br />
-       // and remove filename from paramterlist<br />
-       unset($argv[$movie_key]);</p>
<p>        // Put the arguments back together again<br />
        $str_args = implode(&#8217; &#8216;, $argv);<br />
@@ -78,7 +70,7 @@<br />
        }</p>
<p>        // Build the execution string<br />
-       $exec = escapeshellcmd(&#8221;mplayer $flags $str_args -quiet&#8221;).&#8221; $escaped_filename&#8221;;<br />
+       $exec = escapeshellcmd(&#8221;mplayer $flags $str_args -quiet&#8221;);</p>
<p>        // Execute the command, save output to an array<br />
        exec($exec, $arr);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
