Giter Club home page Giter Club logo

Comments (5)

matt-hensley avatar matt-hensley commented on July 16, 2024 1

MediaPlaylist.Segments is a slice. DecodeFrom auto-initializes the slice to a length of 1024: https://github.com/grafov/m3u8/blob/master/reader.go#L154

Instead use MediaPlaylist.Count method to get the current number of segments in the playlist. See https://github.com/grafov/m3u8/blob/master/writer.go#L504

from m3u8.

iivarih avatar iivarih commented on July 16, 2024

This really is an issue...

Also len(Segments) == 1024 when you only have 3 segments... so in for-range loop you need to check nil values...

from m3u8.

chobits avatar chobits commented on July 16, 2024

I have the same question.
There are head, tail and count private fields of MediaPlaylist structure, but only count field is exported via MediaPlaylist.Count() method.

from m3u8.

bradleyfalzon avatar bradleyfalzon commented on July 16, 2024

If there's additional APIs people want, let me know and I should be able to implement. We've had similar requirements, but using .Count() methods has been fine for us (if the issue is only len(Segments)).

from m3u8.

bradleyfalzon avatar bradleyfalzon commented on July 16, 2024

#70 adds the ability for playlist to auto extend beyond 1024 segments and exposes winsize.

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.