GithubHelp home page GithubHelp logo

Comments (5)

grafov avatar grafov commented on July 29, 2024 1

For sure are you about comma in the end? So I have edited the title.

from m3u8.

bradleyfalzon avatar bradleyfalzon commented on July 29, 2024 1

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.

grafov avatar grafov commented on July 29, 2024

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.

igk1972 avatar igk1972 commented on July 29, 2024

@grafov
I was wrong, of course it's a comma

from m3u8.

bradleyfalzon avatar bradleyfalzon commented on July 29, 2024

OK, have a look at #85 and see if that's suitable.

from m3u8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.