[FFmpeg-devel] [PATCH] Fig bug when incrementing initial_prog_date_time when
Steven Liu
lingjiujianke at gmail.com
Tue Dec 27 04:14:21 EET 2016
2016-12-17 15:57 GMT+08:00 Robert Nagy <ronag89 at gmail.com>:
> From 8b7499f6ddb32bd1f9ee5f2413bf30664af58799 Mon Sep 17 00:00:00 2001
> From: Jesper Ek <deadbeef84 at gmail.com>
> Date: Wed, 7 Dec 2016 15:56:33 +0100
> Subject: [PATCH] Fig bug when incrementing initial_prog_date_time when
> removing segments
>
> initial_prog_date_time shouldn't be adjusted when deleting segments
> from disk, but rather when segments are removed from the playlist.
> ---
> libavformat/hlsenc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index acf3a30..d03cf02 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -185,7 +185,6 @@ static int hls_delete_old_segments(HLSContext *hls) {
> segment = hls->old_segments;
> while (segment) {
> playlist_duration -= segment->duration;
> - hls->initial_prog_date_time += segment->duration;
> previous_segment = segment;
> segment = previous_segment->next;
> if (playlist_duration <= -previous_segment->duration) {
> @@ -414,6 +413,7 @@ static int hls_append_segment(struct AVFormatContext
> *s, HLSContext *hls, double
>
> if (hls->max_nb_segments && hls->nb_entries >= hls->max_nb_segments) {
> en = hls->segments;
> + hls->initial_prog_date_time += en->duration;
> hls->segments = en->next;
> if (en && hls->flags & HLS_DELETE_SEGMENTS &&
> !(hls->flags & HLS_SINGLE_FILE || hls->wrap)) {
> --
> 2.10.0
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
applied!
and fix patch typo.
Thanks!
More information about the ffmpeg-devel
mailing list