diff mbox

[FFmpeg-devel,1/3] Fix computation of vs->start_pos

Message ID 47f642c9-95d4-d920-80d4-863321ad3ebe@hotstar.com
State Superseded
Headers show

Commit Message

Amit Kale Feb. 12, 2018, 8:53 a.m. UTC
Reset vs->start_pos when beginning a new file.
---
  libavformat/hlsenc.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

              av_free(old_filename);
              return ret;

Comments

Michael Niedermayer Feb. 13, 2018, 12:21 p.m. UTC | #1
On Mon, Feb 12, 2018 at 02:23:07PM +0530, Amit Kale wrote:
> Reset vs->start_pos when beginning a new file.
> ---
>  libavformat/hlsenc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index cc13c94e97..9970c4c575 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2227,7 +2227,10 @@ static int hls_write_packet(AVFormatContext *s,
> AVPacket *pkt)
>              ff_format_io_close(s, &vs->out);
>          }
>          ret = hls_append_segment(s, hls, vs, vs->duration, vs->start_pos,
> vs->size);
> -        vs->start_pos = new_start_pos;

This patch is corrupted by a line break

[...]
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index cc13c94e97..9970c4c575 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2227,7 +2227,10 @@  static int hls_write_packet(AVFormatContext *s, 
AVPacket *pkt)
              ff_format_io_close(s, &vs->out);
          }
          ret = hls_append_segment(s, hls, vs, vs->duration, 
vs->start_pos, vs->size);
-        vs->start_pos = new_start_pos;
+        if (hls->flags & HLS_SINGLE_FILE)
+            vs->start_pos = new_start_pos;
+        else
+            vs->start_pos = 0;
          if (ret < 0) {