[FFmpeg-devel] [PATCH 10/18] avformat/hls: add support for byte-ranged segments

Michael Niedermayer michaelni at gmx.at
Tue Dec 31 04:19:09 CET 2013


On Tue, Dec 31, 2013 at 05:13:03AM +0200, Anssi Hannula wrote:
> 31.12.2013 05:05, Michael Niedermayer kirjoitti:
> > On Mon, Dec 30, 2013 at 01:14:24PM +0200, Anssi Hannula wrote:
> >> Add support for EXT-X-BYTERANGE added in HLS protocol v4.
> >>
> >> Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
> >> ---
> >>  libavformat/hls.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
> >>  1 file changed, 61 insertions(+), 2 deletions(-)
> >>
> [...]
> >> @@ -635,8 +671,22 @@ static int open_input(HLSContext *c, struct playlist *pls)
> >>      else
> >>        ret = AVERROR(ENOSYS);
> >>  
> >> +    /* Seek to the requested position. If this was a HTTP request,
> >> +     * the offset should already be there. */
> >> +    if (ret == 0) {
> >> +        int seekret = ffurl_seek(pls->input, seg->url_offset, SEEK_SET);
> >> +        if (seekret < 0) {
> >> +            av_log(pls->parent, AV_LOG_ERROR, "Unable to seek to offset %"PRId64" of HLS segment '%s'\n", seg->url_offset, seg->url);
> >> +            ret = seekret;
> >> +            ffurl_close(pls->input);
> >> +            pls->input = NULL;
> >> +        }
> >> +    }
> > 
> > maybe i misunderstand something but why do you need to seek if the
> > offset was already provided to the protocol ?
> 
> Well, in case the protocol is not HTTP. Of course that is indeed a bit
> far-fetched as it is "HTTP Live Streaming" ;)
> 
> This was useful for local testing without needing a HTTP server, though.
> I'm not too heavily against removing it, but it doesn't really hurt
> either so I kept it...

i dont mind if it stays but it should be better documented why its
there

also if it can be tested locally without the need for http servers
then a fate test for it would be very welcome. i can upload some
small files to the rsync server if needed ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131231/2740d2d5/attachment.asc>


More information about the ffmpeg-devel mailing list