Browse Source

avformat/hlsenc.c: fix the output's duration smaller than input's in sub-range mode.

In fmp4 & sub-range mode, the output's duration always smaller than expected,
because the size of the last #EXT-X-BYTERANGE is too small.

Signed-off-by: Charles Liu <liuchh83@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
tags/n4.1
Charles Liu Steven Liu 7 years ago
parent
commit
1ff4bd59df
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      libavformat/hlsenc.c

+ 1
- 2
libavformat/hlsenc.c View File

@@ -2380,6 +2380,7 @@ static int hls_write_trailer(struct AVFormatContext *s)
if (ret < 0) { if (ret < 0) {
goto failed; goto failed;
} }
vs->size = range_length;
ff_format_io_close(s, &vs->out); ff_format_io_close(s, &vs->out);
} }


@@ -2388,8 +2389,6 @@ failed:
if (oc->pb) { if (oc->pb) {
if (hls->segment_type != SEGMENT_TYPE_FMP4) { if (hls->segment_type != SEGMENT_TYPE_FMP4) {
vs->size = avio_tell(vs->avf->pb) - vs->start_pos; vs->size = avio_tell(vs->avf->pb) - vs->start_pos;
} else {
vs->size = avio_tell(vs->avf->pb);
} }
if (hls->segment_type != SEGMENT_TYPE_FMP4) if (hls->segment_type != SEGMENT_TYPE_FMP4)
ff_format_io_close(s, &oc->pb); ff_format_io_close(s, &oc->pb);


Loading…
Cancel
Save