Ticket #5041: mythweb_detect_ffmpeg_mp3.diff.txt

File mythweb_detect_ffmpeg_mp3.diff.txt, 1.6 KB (added by Jo Shields <directhex@…>, 12 years ago)
Line 
1diff -ur mythplugins-0.21.0.orig/mythweb/modules/mythweb/tmpl/default/set_flvplayer.php mythplugins-0.21.0/mythweb/modules/mythweb/tmpl/default/set_flvplayer.php
2--- mythplugins-0.21.0.orig/mythweb/modules/mythweb/tmpl/default/set_flvplayer.php      2008-03-26 01:40:08.287124525 +0000
3+++ mythplugins-0.21.0/mythweb/modules/mythweb/tmpl/default/set_flvplayer.php   2008-03-26 02:16:48.059827759 +0000
4@@ -25,7 +25,22 @@
5     <th><?php echo t('Enable Video Playback') ?>:</th>
6     <td><input class="radio" type="checkbox" name="flvplayer"
7          title="Enable Flash Video player for recordings."
8-         <?php if (setting('WebFLV_on')) echo ' CHECKED' ?>></td>
9+         <?php $ffmpeg = '';
10+          foreach (split (':', getenv ('PATH').':/usr/local/bin:/usr/bin') as $path) {
11+              if (file_exists ($path."/ffmpeg")) {
12+                  $ffmpeg = $path."/ffmpeg";
13+                  break;
14+              }
15+              elseif (php_uname ('s') == 'Darwin' && file_exists ($path."/ffmpeg.app")) {
16+                  $ffmpeg = $path."/ffmpeg".app;
17+                  break;
18+              }
19+          }
20+          $ffmpeg_output = shell_exec ("$ffmpeg --help 2>&1");
21+          $has_mp3_support = strpos ($ffmpeg_output, "mp3");
22+          if (!$has_mp3_support) echo ' DISABLED' ?>
23+         <?php if (setting('WebFLV_on')) echo ' CHECKED' ?>>
24+         <?php if (!$has_mp3_support) echo ' ffmpeg with MP3 support not detected' ?></td>
25 </tr><tr>
26     <th valign="top"><?php echo t('Width') ?>:</th>
27     <td><input type="text" name="width"