From ece8847b9cd70a9e075519060ed1a7faac1ea1ba Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 3 Nov 2021 11:16:06 -0700 Subject: [PATCH] fix to m3u8 --- timestamp-id3.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/timestamp-id3.php b/timestamp-id3.php index 359bd2e..f6e041b 100644 --- a/timestamp-id3.php +++ b/timestamp-id3.php @@ -137,6 +137,11 @@ foreach ( $lines as $line ) { if ( preg_match( '/^#EXTINF:\s*(\d+(?:\.\d+)?),/', $line, $matches ) ) { $duration = floatval( $matches[1] ); } + if ( preg_match( '/^#EXT-X-VERSION:(.*)/', $line, $matches ) ) { + if ( intval( $matches[1] ) < 4 ) { + $line = "#EXT-X-VERSION:7"; + } + } if (preg_match( '/^#/', $line ) ) { $lines_out[] = $line; continue;