FormatMetadata: Use binary integer literals instead of bindec()
authorKevin Israel <pleasestand@live.com>
Tue, 14 Jun 2016 04:26:29 +0000 (00:26 -0400)
committerKevin Israel <pleasestand@live.com>
Tue, 14 Jun 2016 04:26:29 +0000 (00:26 -0400)
We can do this now that we have dropped support for PHP 5.3.

Change-Id: I1e78249e244105496e976bf01e35f4067410b2f0

includes/media/FormatMetadata.php

index 5fbdcc7..78b0296 100644 (file)
@@ -418,12 +418,12 @@ class FormatMetadata extends ContextSource {
 
                                        case 'Flash':
                                                $flashDecode = [
-                                                       'fired' => $val & bindec( '00000001' ),
-                                                       'return' => ( $val & bindec( '00000110' ) ) >> 1,
-                                                       'mode' => ( $val & bindec( '00011000' ) ) >> 3,
-                                                       'function' => ( $val & bindec( '00100000' ) ) >> 5,
-                                                       'redeye' => ( $val & bindec( '01000000' ) ) >> 6,
-                                                       // 'reserved' => ( $val & bindec( '10000000' ) ) >> 7,
+                                                       'fired' => $val & 0b00000001,
+                                                       'return' => ( $val & 0b00000110 ) >> 1,
+                                                       'mode' => ( $val & 0b00011000 ) >> 3,
+                                                       'function' => ( $val & 0b00100000 ) >> 5,
+                                                       'redeye' => ( $val & 0b01000000 ) >> 6,
+                                                       // 'reserved' => ( $val & 0b10000000 ) >> 7,
                                                ];
                                                $flashMsgs = [];
                                                # We do not need to handle unknown values since all are used.