r65927 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65926‎ | r65927 | r65928 >
Date:01:22, 5 May 2010
Author:hartman
Status:deferred
Tags:
Comment:
Account for non-square pixel aspect ratios when retrieving the dimensions of theora streams.
Modified paths:
  • /trunk/extensions/OggHandler/OggHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OggHandler/OggHandler_body.php
@@ -107,8 +107,15 @@
108108 }
109109 foreach ( $metadata['streams'] as $stream ) {
110110 if ( in_array( $stream['type'], $wgOggVideoTypes ) ) {
 111+ $pictureWidth = $stream['header']['PICW'];
 112+ $parNumerator = $stream['header']['PARN'];
 113+ $parDenominator = $stream['header']['PARD'];
 114+ if( $parNumerator && $parDenominator ) {
 115+ // Compensate for non-square pixel aspect ratios
 116+ $pictureWidth = $pictureWidth * $parNumerator / $parDenominator;
 117+ }
111118 return array(
112 - $stream['header']['PICW'],
 119+ $pictureWidth,
113120 $stream['header']['PICH']
114121 );
115122 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r87391Make sure video sizes are int's....hartman11:28, 4 May 2011
r87924Forwardport r65927 from OggHandler to TimedMediaHandlerhartman19:51, 12 May 2011

Status & tagging log