Skip to content

Commit

Permalink
Update frame rate parsing from *.ttml file to handle cases where para…
Browse files Browse the repository at this point in the history
…meters may not be defined.
  • Loading branch information
eijei521 committed Jun 27, 2023
1 parent c5e2e75 commit f21b6c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Code/Converters/TtmlConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ protected static function internalTimeToTtml($internal_time)
protected static function framesPerSecond($dom)
{
$ttElement = $dom->getElementsByTagName('tt')->item(0);
$frameRate = $ttElement->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRate');
$frameRateMultiplier = $ttElement->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRateMultiplier');
$frameRate = $ttElement?->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRate');
$frameRateMultiplier = $ttElement?->getAttributeNS('http://www.w3.org/ns/ttml#parameter', 'frameRateMultiplier');

if ($frameRate && $frameRateMultiplier) {
list($numerator, $denominator) = array_map('intval', explode(' ', $frameRateMultiplier));
Expand Down

0 comments on commit f21b6c4

Please sign in to comment.