r87924 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87923‎ | r87924 | r87925 >
Date:19:51, 12 May 2011
Author:hartman
Status:deferred
Tags:
Comment:
Forwardport r65927 from OggHandler to TimedMediaHandler
Modified paths:
  • /trunk/extensions/TimedMediaHandler/handlers/OggHandler/OggHandler.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/handlers/OggHandler/OggHandler.php
@@ -58,8 +58,15 @@
5959 }
6060 foreach ( $metadata['streams'] as $stream ) {
6161 if ( in_array( $stream['type'], $wgMediaVideoTypes ) ) {
 62+ $pictureWidth = $stream['header']['PICW'];
 63+ $parNumerator = $stream['header']['PARN'];
 64+ $parDenominator = $stream['header']['PARD'];
 65+ if( $parNumerator && $parDenominator ) {
 66+ // Compensate for non-square pixel aspect ratios
 67+ $pictureWidth = $pictureWidth * $parNumerator / $parDenominator;
 68+ }
6269 return array(
63 - $stream['header']['PICW'],
 70+ $pictureWidth,
6471 $stream['header']['PICH']
6572 );
6673 }
@@ -195,4 +202,4 @@
196203 return $length == 0 ? 0 : $size / $length * 8;
197204 }
198205
199 -}
\ No newline at end of file
 206+}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65927Account for non-square pixel aspect ratios when retrieving the dimensions of ...hartman01:22, 5 May 2010

Status & tagging log