Piwigo / piwigo-videojs

Videojs port for piwigo. Play your videos on your web gallery!
http://piwigo.org/ext/extension_view.php?eid=610
GNU General Public License v3.0
67 stars 46 forks source link

Fatal error for videos #155

Open gewahl opened 5 years ago

gewahl commented 5 years ago

Fatal error: 'break' not in the 'loop' or 'switch' context in .../plugins/piwigo-jplayer/include/getid3/getid3.lib.php on line 285 Has this to do with upgrade to PHP 7?

guano commented 4 years ago
        public static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) {
                $intvalue = 0;
                $bytewordlen = strlen($byteword);
                if ($bytewordlen == 0) {
                        return false;
                }
                for ($i = 0; $i < $bytewordlen; $i++) {
                        if ($synchsafe) { // disregard MSB, effectively 7-bit bytes
                                //$intvalue = $intvalue | (ord($byteword{$i}) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems
                                $intvalue += (ord($byteword{$i}) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7);
                        } else {
                                $intvalue += ord($byteword{$i}) * pow(256, ($bytewordlen - 1 - $i));
                        }
                }
                if ($signed && !$synchsafe) {
                        // synchsafe ints are not allowed to be signed
                        if ($bytewordlen <= PHP_INT_SIZE) {
                                $signMaskBit = 0x80 << (8 * ($bytewordlen - 1));
                                if ($intvalue & $signMaskBit) {
                                        $intvalue = 0 - ($intvalue & ($signMaskBit - 1));
                                }
                        } else {
                                throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits ('.strlen($byteword).') in self::BigEndian2Int()');
                                //break; // LINE 285 IS THIS LINE HERE
                        }
                }
                return self::CastAsInt($intvalue);
        }

I found the place where the error is supposed to have occured. Commenting it out or changing the break to a return allows videos to play, but the video is huge, taking up much more space than is on my screen. Scrolling down and clicking the "full-screen" button resizes the video appropriately, however

guano commented 4 years ago

Looks like there is a similar issue in JPlayer: https://github.com/d-matt/piwigo-jplayer/issues/14