Comments (5)
For sure are you about comma in the end? So I have edited the title.
from m3u8.
I agree @grafov, it seems safe to be a little less strict. Something like:
diff --git a/reader.go b/reader.go
index cabe0a8..7f035ea 100644
--- a/reader.go
+++ b/reader.go
@@ -358,7 +358,10 @@ func decodeLineOfMediaPlaylist(p *MediaPlaylist, wv *WV, state *decodingState, l
state.listType = MEDIA
sepIndex := strings.Index(line, ",")
if sepIndex == -1 {
- break
+ if strict {
+ return fmt.Errorf("could not parse: %q", line)
+ }
+ sepIndex = len(line)
}
duration := line[8:sepIndex]
if len(duration) > 0 {
This will now error when in strict mode instead of silently discarding the EXTINF duration, and allows the user to switch to a non-strict parsing to accept the bad input.
Note, I did try to refactor the switch statement slightly, but every time there was a performance hit, and we have a couple users concerned about the speed, so I'm happy with maintaining the change as it is.
from m3u8.
It looks like these playlists don't support standard. So then it is not a bug but a feature for the library - support broken playlists. I think support of these broken playlists will not affect valid playlists so we can add this "feature". What do you think @bradleyfalzon?
from m3u8.
@grafov
I was wrong, of course it's a comma
from m3u8.
OK, have a look at #85 and see if that's suitable.
from m3u8.
Related Issues (20)
- Under load encoder does not perform correctly HOT 3
- Using for range loop to MediaPlaylist.Segments would lead to nil pointer dereference HOT 2
- Fix a report card issues for passing to awesome-go list HOT 1
- M3U8 doesn't play after some time HOT 1
- EXT-X-MEDIA audio missing from VariantParams.Alternatives for master playlist decode HOT 1
- . HOT 2
- MediaPlaylist decode custom tag panic
- m3u8.DecodeFrom panics in case of blank lines in playlist
- I have a SCTE-35 parser...... HOT 1
- SCTE35 - EXT-OATCLS-SCTE35 with EXT-X-CUE-IN
- tag: #EXT-X-MEDIA attribute: CHANNELS is not recognized HOT 1
- Is this repo dead? HOT 3
- program panic when i get the url of media segments HOT 6
- safari play fail bug
- Doesn't handle "Alternatives" correctly inside a master playlist's "variants"
- program panic when I parse the media segments
- Decoding MediaPlaylist panics with error: index out of range [0] with length 0 HOT 2
- Support Tag #EXT-X-IMAGE-STREAM-INF
- set Segment key error
- Duplicate Data Resulting from Custom Tags HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from m3u8.