rpms/mythweb/F-17 mythweb-0.26-fixes.patch, NONE, 1.1 ChangeLog, 1.2, 1.3 mythweb.spec, 1.4, 1.5

Richard Shaw hobbes1069 at rpmfusion.org
Mon Dec 24 20:24:22 CET 2012


Author: hobbes1069

Update of /cvs/free/rpms/mythweb/F-17
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv9244

Modified Files:
	ChangeLog mythweb.spec 
Added Files:
	mythweb-0.26-fixes.patch 
Log Message:
* Sat Dec 08 2012 Richard Shaw <hobbes1069 at gmail.com> - 0.26.0-2
- Update to latest upstream release.


mythweb-0.26-fixes.patch:
 classes/Video.php                    |   14 ++++---
 modules/stream/stream_raw.pl         |    4 ++
 modules/video/handler.php            |   26 +++++++++----
 modules/video/stream.php             |   69 +++++++++++++++++++++++++++++++++++
 modules/video/tmpl/default/video.php |    2 -
 mythweb.php                          |    2 -
 6 files changed, 101 insertions(+), 16 deletions(-)

--- NEW FILE mythweb-0.26-fixes.patch ---
 classes/Video.php                    | 14 ++++----
 modules/stream/stream_raw.pl         |  4 +++
 modules/video/handler.php            | 26 +++++++++-----
 modules/video/stream.php             | 69 ++++++++++++++++++++++++++++++++++++
 modules/video/tmpl/default/video.php |  2 +-
 mythweb.php                          |  2 +-
 6 files changed, 101 insertions(+), 16 deletions(-)

diff --git a/classes/Video.php b/classes/Video.php
index 7995aa4..5c6f7e4 100644
--- a/classes/Video.php
+++ b/classes/Video.php
@@ -90,12 +90,14 @@ class Video {
         $this->childid = $video['childid'];
     // Figure out the URL
         $this->url = '#';
-        if (file_exists('data/video/'))
-            $this->url = implode('/', array_map('rawurlencode',
-                                             array_map('utf8tolocal',
-                                             explode('/',
-                                             'data/video/' . preg_replace('#^'.$mythvideo_dir.'/?#', '', $this->filename)
-                                       ))));
+    //// all junk, replacing
+//        if (file_exists('data/video/'))
+//            $this->url = implode('/', array_map('rawurlencode',
+//                                             array_map('utf8tolocal',
+//                                             explode('/',
+//                                             'data/video/' . preg_replace('#^'.$mythvideo_dir.'/?#', '', $this->filename)
+//                                       ))));
+        $this->url = 'video/stream?Id=' . $this->intid;
         $genre = $db->query('SELECT idgenre
                                FROM videometadatagenre
                               WHERE idvideo = ?',
diff --git a/modules/stream/stream_raw.pl b/modules/stream/stream_raw.pl
index 31f6854..6981bca 100755
--- a/modules/stream/stream_raw.pl
+++ b/modules/stream/stream_raw.pl
@@ -30,6 +30,10 @@
         $type   = 'video/nuppelvideo';
         $suffix = '.nuv';
     }
+    elsif ($basename =~ /\.mkv$/) {
+        $type   = 'video/x-matroska';
+        $suffix = '.mkv';
+    }
     else {
         print header(),
               "Unknown video type requested:  $basename\n";
diff --git a/modules/video/handler.php b/modules/video/handler.php
index fd769ce..721f186 100644
--- a/modules/video/handler.php
+++ b/modules/video/handler.php
@@ -15,8 +15,10 @@
  * @global  string   $GLOBALS['mythvideo_dir']
  * @name    $mythvideo_dir
 /**/
-    global $mythvideo_dir;
-    $mythvideo_dir = setting('VideoStartupDir', hostname);
+
+//// dont need this...
+//    global $mythvideo_dir;
+//    $mythvideo_dir = setting('VideoStartupDir', hostname);
 
 // Load the video storage directories
     $video_dirs = $db->query_list('
@@ -37,6 +39,7 @@
         }
     }
 
+/** nor any of this...
 // Make sure the video directory exists
     if (file_exists('data/video')) {
     // File is not a directory or a symlink
@@ -93,7 +96,7 @@
                         .' reload this page.');
         }
     // Create a symlink to the first artwork directory that we find.
-    /** @todo we should really support multiple directories, but it's too much effort to hack in at the moment. */
+    // @todo we should really support multiple directories, but it's too much effort to hack in at the moment.
         else {
             foreach ($artwork_dirs as $dir) {
                 if (is_dir($dir) || is_link($dir)) {
@@ -116,6 +119,7 @@
             }
         }
     }
+*/
 
     define('video_img_height',  _or(setting('web_video_thumbnail_height', hostname), 140));
     define('video_img_width',   _or(setting('web_video_thumbnail_width', hostname),   94));
@@ -125,11 +129,17 @@
         case 'edit':
             require_once 'modules/video/edit.php';
             exit;
-        case 'imdb':
-            require_once 'modules/video/imdb.php';
-            exit;
-        case 'scan':
-            require_once 'modules/video/scan.php';
+//// this is probably doing bad things
+//        case 'imdb':
+//            require_once 'modules/video/imdb.php';
+//            exit;
+//// this is broken, so disable it
+//        case 'scan':
+//            require_once 'modules/video/scan.php';
+//            exit;
+//// new stuff
+        case 'stream':
+            require_once 'modules/video/stream.php';
             exit;
     }
 
diff --git a/modules/video/stream.php b/modules/video/stream.php
new file mode 100644
index 0000000..49a7298
--- /dev/null
+++ b/modules/video/stream.php
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Stream a music file
+ *
+ * @license     GPL
+ *
+ * @package     MythWeb
+ * @subpackage  Music
+/**/
+
+// Yes, a db connection
+    global $db;
+
+// Pull video ID
+    $vid_id = $_GET['Id'];
+
+// Get filename
+    list($fname) = $db->query_row('SELECT filename
+                                     FROM videometadata
+                                    WHERE intid = ?', $vid_id);
+
+// Mime type
+    switch (substr($fname, strrpos($fname, '.'))) {
+        case 'mpg':
+        case 'mpeg':
+            $mime = 'video/mpeg';
+            break;
+        case 'mp4':
+            $mime = 'video/mp4';
+            break;
+        case 'ogg':
+        case 'ogm':
+        case 'ogv':
+            $mime = 'video/ogg';
+            break;
+        case 'qt':
+            $mime = 'video/quicktime';
+            break;
+        case 'webm':
+            $mime = 'video/webm';
+            break;
+        case 'mkv':
+            $mime = 'video/x-matroska';
+            break;
+        case 'wmv':
+            $mime = 'video/x-ms-wmv';
+            break;
+        case 'flv':
+            $mime = 'video/x-flv';
+            break;
+        default:
+            $mime = 'applicatoin/octet-stream';
+    }
+    header('Content-Type: '.$mime);
+
+// Send the filename
+    header('Content-Disposition: filename="'.$fname.'"');
+
+// Send data via the backend
+    $Master_Host = setting('MasterServerIP');
+    $port = _or(get_backend_setting('BackendStatusPort', $Master_Host),
+                get_backend_setting('BackendStatusPort'));
+    if (stripos($Master_Host,':') !== false) {
+        $Master_Host = '['.$Master_Host.']';
+    }
+    readfile("http://$Master_Host:$port/Content/GetVideo?Id=".$vid_id);
+
+// Nothing else to do
+    exit;
diff --git a/modules/video/tmpl/default/video.php b/modules/video/tmpl/default/video.php
index e80176e..ad7e9a9 100644
--- a/modules/video/tmpl/default/video.php
+++ b/modules/video/tmpl/default/video.php
@@ -252,7 +252,7 @@
 <table width="100%" border="0" cellpadding="4" cellspacing="2" class="list small">
 <tr class="menu">
 <td>
- <span style="float: right"><input type="button" value="<?php echo t('Scan Collection'); ?>" class="submit" onclick="scan()"></span>
+<!-- Bad! Don't do this! <span style="float: right"><input type="button" value="<?php echo t('Scan Collection'); ?>" class="submit" onclick="scan()"></span> -->
  <form action="<?php echo root_url; ?>video" method="GET">
   <?php echo t('Display'); ?>:
   <select name="category" id="category" onchange="filter();">
diff --git a/mythweb.php b/mythweb.php
index bba2aa8..79ff196 100644
--- a/mythweb.php
+++ b/mythweb.php
@@ -30,7 +30,7 @@
     if (Modules::getModule($Path[0])) {
     // Add the current module directory to our search path, so modules can
     // define includes, etc.
-        ini_set('include_path', ini_get('include_path').':'.modules_path.'/'.$Path[0]);
+        ini_set('include_path', ini_get('include_path').PATH_SEPARATOR.modules_path.'/'.$Path[0]);
     // Load the module handler
         require_once 'handler.php';
     }


Index: ChangeLog
===================================================================
RCS file: /cvs/free/rpms/mythweb/F-17/ChangeLog,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ChangeLog	30 Jul 2012 21:14:58 -0000	1.2
+++ ChangeLog	24 Dec 2012 19:24:21 -0000	1.3
@@ -0,0 +1,21 @@
+commit f82ca9521775edbbc53caf0f40f7bc183732dcc2
+Author: Karl Dietz <dekarl at users.sourceforge.net>
+Date:   Fri Aug 3 23:26:30 2012 +0200
+
+    Use PATH_SEPARATOR rather than ':' in mythweb.php.
+    
+    Fixes #10791
+    
+    Signed-off-by: Raymond Wagner <rwagner at mythtv.org>
+    (cherry picked from commit f9f5a1f43f2ddfeaa038054226f6ac0aa0b973e6)
+
+commit 4fd9d5e05065c31e574e69251f872b1f53b7b027
+Author: R.D. Vaughan <r.d.vaughan at rogers.com>
+Date:   Tue Oct 16 06:00:31 2012 -0400
+
+    Add recognition of mkv containers to MythWeb for raw streaming.
+    
+    Fixes #11180
+    
+    Signed-off-by: Raymond Wagner <rwagner at mythtv.org>
+    (cherry picked from commit ce2368132f823284588b02f8a1f66e0576d8c107)


Index: mythweb.spec
===================================================================
RCS file: /cvs/free/rpms/mythweb/F-17/mythweb.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- mythweb.spec	29 Oct 2012 20:42:21 -0000	1.4
+++ mythweb.spec	24 Dec 2012 19:24:22 -0000	1.5
@@ -9,7 +9,7 @@
 Group:          Applications/Multimedia
 
 Version:        0.26.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 
 License:        GPLv2 and LGPLv2 and MIT
 
@@ -18,6 +18,8 @@
 Source1:        mythweb.conf
 Source2:        ChangeLog
 
+Patch0:         mythweb-0.26-fixes.patch
+
 # Patch generated from mythweb fixes branch. From mythweb git directory:
 # git diff -p --stat %{version} > mythweb-fixes.patch
 #Patch0:         mythweb-fixes.patch
@@ -43,7 +45,7 @@
 
 %prep
 %setup -q -n MythTV-mythweb-%{githash2}
-#patch1 -p1 -b .php54
+%patch0 -p1
 
 # Fix directory permissions
 #find ./ -type d -exec chmod 0755 {} \;
@@ -64,8 +66,9 @@
 cp -a * %{buildroot}%{_datadir}/mythweb/
 mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
 cp %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/
-# drop .htaccess file, settings handled in the above
-rm -f %{buildroot}%{_datadir}/mythweb/data/.htaccess
+
+# Remove stuff covered by %%doc
+rm %{buildroot}%{_datadir}/mythweb/{LICENSE,README,INSTALL,ChangeLog}
 
 
 %files
@@ -76,8 +79,11 @@
 
 
 %changelog
+* Sat Dec 08 2012 Richard Shaw <hobbes1069 at gmail.com> - 0.26.0-2
+- Update to latest upstream release.
+
 * Sun Oct 28 2012 Richard Shaw <hobbes1069 at gmail.com> - 0.26.0-1
-* Update to latest upstream release.
+- Update to latest upstream release.
 
 * Mon Jul 30 2012 Richard Shaw <hobbes1069 at gmail.com> - 0.25.2-1
 - Update to latests release.


More information about the rpmfusion-commits mailing list