Ticket #6023: mythweb_stream_aspect.patch

File mythweb_stream_aspect.patch, 1.7 KB (added by bradd@…, 15 years ago)
  • modules/stream/stream_flv.pl

     
    4141    my ($vbitrate) = $sh->fetchrow_array;
    4242    $sh->execute('WebFLV_ab');
    4343    my ($abitrate) = $sh->fetchrow_array;
    44 # Someday, we can auto-detect height based on aspect ratio
    45     my $height = int($width * 3/4);
    46 
    4744    $sh->finish();
     45# auto-detect height based on aspect ratio
     46    $sh = $dbh->prepare('SELECT data FROM recordedmarkup WHERE chanid=? AND starttime=FROM_UNIXTIME(?) AND data IS NOT NULL ORDER BY data DESC');
     47    $sh->execute($chanid,$starttime);
     48    $x = $sh->fetchrow_array;
     49    $y = $sh->fetchrow_array if ($x);
     50    if ($x && $y) {
     51        $height = int($width * ($y/$x));
     52    } else {
     53        $height = int($width * 3/4);
     54    }
     55    $sh->finish();
    4856
    4957    $width    = 320 unless ($width    && $width    > 1);
    5058    $height   = 240 unless ($height   && $height   > 1);
  • modules/mythweb/tmpl/default/set_flvplayer.php

     
    5252    <td><input type="text" name="width"
    5353         size="5" title="FLV Width"
    5454         value="<?php echo intVal(_or(setting('WebFLV_w'), 320)) ?>" />
    55          x
    56          <?php echo intVal(_or(setting('WebFLV_w'), 320) * 3/4) ?>
    5755         <br>
    58          (hard-coded at 4:3 until we can detect recording aspect)
     56         (height is calculated automatically from the recording aspect ratio)
    5957         </td>
    6058</tr><tr>
    6159    <th><?php echo t('Video Bitrate') ?>:</th>