Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error for videos #155

Open
gewahl opened this issue Jun 27, 2019 · 2 comments
Open

Fatal error for videos #155

gewahl opened this issue Jun 27, 2019 · 2 comments

Comments

@gewahl
Copy link

gewahl commented Jun 27, 2019

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
Copy link

guano commented Feb 25, 2020

        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
Copy link

guano commented Feb 25, 2020

Looks like there is a similar issue in JPlayer: d-matt/piwigo-jplayer#14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants