Index: trunk/extensions/TimedMediaHandler/handlers/OggHandler/OggHandler.php |
— | — | @@ -58,8 +58,15 @@ |
59 | 59 | } |
60 | 60 | foreach ( $metadata['streams'] as $stream ) { |
61 | 61 | 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 | + } |
62 | 69 | return array( |
63 | | - $stream['header']['PICW'], |
| 70 | + $pictureWidth, |
64 | 71 | $stream['header']['PICH'] |
65 | 72 | ); |
66 | 73 | } |
— | — | @@ -195,4 +202,4 @@ |
196 | 203 | return $length == 0 ? 0 : $size / $length * 8; |
197 | 204 | } |
198 | 205 | |
199 | | -} |
\ No newline at end of file |
| 206 | +} |