[FFmpeg-devel] [PATCH] applehttp: reload interval is duration of last segment

Andrey Utkin andrey.krieger.utkin at gmail.com
Mon Dec 26 20:52:42 CET 2011

According to draft-pantos-http-live-streaming-07, 6.3.4.,
=== quote ===
The initial minimum reload delay is the duration of the last media
segment in the Playlist.  Media segment duration is specified by the
If the client reloads a Playlist file and finds that it has not
changed then it MUST wait for a period of one-half the target
duration before retrying.
=== quote end ===
Did not implement the second part (if playlist has not changed).
Previously, playlist reloading interval was TARGETDURATION seconds,
and lags have happened at playback.
Now reloading interval is last known (listed in playlist) segment's
EXTINF value.
Tested old and new way with Wowza 3.0.2 patch3.
 libavformat/applehttp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 99febc6..a1fcea1 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -393,7 +393,7 @@ reload:
             if (v->finished)
                 return AVERROR_EOF;
             while (av_gettime() - v->last_load_time <
-                   v->target_duration*1000000) {
+                   v->segments[v->n_segments-1]->duration * 1000000) {
                 if (ff_check_interrupt(c->interrupt_callback))
                     return AVERROR_EXIT;

Andrey Utkin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-applehttp-reload-interval-is-duration-of-last-segmen.patch
Type: text/x-patch
Size: 1589 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111226/4ed8d90a/attachment.bin>

More information about the ffmpeg-devel mailing list