You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1544 implements support for the EXT-X-START:TIME-OFFSET tag, however the regular expression defined in HlsPlaylistParser is incorrect because it does not recognise negative offsets. However, the code in HlsMediaPlaylist that sets the offset is correctly implemented because it does take into account negative numbers.
The fix is therefore a simple one: in com/google/android/exoplayer2/source/hls/playlist/HlsPlaylistParser the string REGEX_TIME_OFFSET should be changed from
private static final Pattern REGEX_TIME_OFFSET = Pattern.compile("TIME-OFFSET=([\\d\\.]+)\\b");
to
private static final Pattern REGEX_TIME_OFFSET = Pattern.compile("TIME-OFFSET=([-\\d\\.]+)\\b");
To reproduce, set the offset value in a media playlist to a negative number and run the demo app.
Reproduced on version 2.2 release using Samsung GT-I9295 (Android 5.0.1 API21)
Logcat snippet:
com.google.android.exoplayer2.ParserException: Couldn't match TIME-OFFSET=([\d\.]+)\b in #EXT-X-START:TIME-OFFSET=-20
at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseStringAttr(HlsPlaylistParser.java:375)
at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseDoubleAttr(HlsPlaylistParser.java:383)
at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:287)
at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:128)
at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:41)
at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:115)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:295)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
The text was updated successfully, but these errors were encountered:
#1544 implements support for the
EXT-X-START:TIME-OFFSET
tag, however the regular expression defined inHlsPlaylistParser
is incorrect because it does not recognise negative offsets. However, the code inHlsMediaPlaylist
that sets the offset is correctly implemented because it does take into account negative numbers.The fix is therefore a simple one: in com/google/android/exoplayer2/source/hls/playlist/HlsPlaylistParser the string
REGEX_TIME_OFFSET
should be changed fromprivate static final Pattern REGEX_TIME_OFFSET = Pattern.compile("TIME-OFFSET=([\\d\\.]+)\\b");
to
private static final Pattern REGEX_TIME_OFFSET = Pattern.compile("TIME-OFFSET=([-\\d\\.]+)\\b");
To reproduce, set the offset value in a media playlist to a negative number and run the demo app.
Reproduced on version 2.2 release using Samsung GT-I9295 (Android 5.0.1 API21)
Logcat snippet:
The text was updated successfully, but these errors were encountered: