diff mbox

[FFmpeg-devel] avformat/hlsenc: move the segment files handle close before temp flags process

Message ID 20170301022350.20053-1-lq@chinaffmpeg.org
State Accepted
Commit 4507f29e4a6a4363e0179c02bdb78d55e4d9a12c
Headers show

Commit Message

Liu Steven March 1, 2017, 2:23 a.m. UTC
fix ticket: #6204

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Steven Liu March 2, 2017, 11:18 p.m. UTC | #1
2017-03-01 10:23 GMT+08:00 Steven Liu <lq@chinaffmpeg.org>:

> fix ticket: #6204
>
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>  libavformat/hlsenc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 9cf6211..b8122f1 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -1329,13 +1329,14 @@ static int hls_write_packet(AVFormatContext *s,
> AVPacket *pkt)
>          new_start_pos = avio_tell(hls->avf->pb);
>          hls->size = new_start_pos - hls->start_pos;
>
> +        ff_format_io_close(s, &oc->pb);
> +        if (hls->vtt_avf) {
> +            ff_format_io_close(s, &hls->vtt_avf->pb);
> +        }
>          if ((hls->flags & HLS_TEMP_FILE) && oc->filename[0]) {
>              if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <=
> 0))
>                  if (hls->avf->oformat->priv_class && hls->avf->priv_data)
>                      av_opt_set(hls->avf->priv_data, "mpegts_flags",
> "resend_headers", 0);
> -            ff_format_io_close(s, &oc->pb);
> -            if (hls->vtt_avf)
> -                ff_format_io_close(s, &hls->vtt_avf->pb);
>              hls_rename_temp_file(s, oc);
>          }
>
> --
> 2.10.1 (Apple Git-78)
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

will push after 24 hours
Steven Liu March 4, 2017, 1:30 a.m. UTC | #2
2017-03-03 7:18 GMT+08:00 Steven Liu <lingjiujianke@gmail.com>:

>
>
> 2017-03-01 10:23 GMT+08:00 Steven Liu <lq@chinaffmpeg.org>:
>
>> fix ticket: #6204
>>
>> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
>> ---
>>  libavformat/hlsenc.c | 7 ++++---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>> index 9cf6211..b8122f1 100644
>> --- a/libavformat/hlsenc.c
>> +++ b/libavformat/hlsenc.c
>> @@ -1329,13 +1329,14 @@ static int hls_write_packet(AVFormatContext *s,
>> AVPacket *pkt)
>>          new_start_pos = avio_tell(hls->avf->pb);
>>          hls->size = new_start_pos - hls->start_pos;
>>
>> +        ff_format_io_close(s, &oc->pb);
>> +        if (hls->vtt_avf) {
>> +            ff_format_io_close(s, &hls->vtt_avf->pb);
>> +        }
>>          if ((hls->flags & HLS_TEMP_FILE) && oc->filename[0]) {
>>              if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <=
>> 0))
>>                  if (hls->avf->oformat->priv_class && hls->avf->priv_data)
>>                      av_opt_set(hls->avf->priv_data, "mpegts_flags",
>> "resend_headers", 0);
>> -            ff_format_io_close(s, &oc->pb);
>> -            if (hls->vtt_avf)
>> -                ff_format_io_close(s, &hls->vtt_avf->pb);
>>              hls_rename_temp_file(s, oc);
>>          }
>>
>> --
>> 2.10.1 (Apple Git-78)
>>
>>
>>
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
> will push after 24 hours
>

pushed


Thanks!
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 9cf6211..b8122f1 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1329,13 +1329,14 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
         new_start_pos = avio_tell(hls->avf->pb);
         hls->size = new_start_pos - hls->start_pos;
 
+        ff_format_io_close(s, &oc->pb);
+        if (hls->vtt_avf) {
+            ff_format_io_close(s, &hls->vtt_avf->pb);
+        }
         if ((hls->flags & HLS_TEMP_FILE) && oc->filename[0]) {
             if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <= 0))
                 if (hls->avf->oformat->priv_class && hls->avf->priv_data)
                     av_opt_set(hls->avf->priv_data, "mpegts_flags", "resend_headers", 0);
-            ff_format_io_close(s, &oc->pb);
-            if (hls->vtt_avf)
-                ff_format_io_close(s, &hls->vtt_avf->pb);
             hls_rename_temp_file(s, oc);
         }