aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorJun Zhao <mypopydev@gmail.com>2018-04-09 23:12:16 +0800
committerJun Zhao <jun.zhao@intel.com>2018-04-12 16:04:58 +0800
commitf1ccb4dbcf0b878120ba3990476ce7059ead2d74 (patch)
tree118328e7c314303915664fe5dd846e7c0e7529f8 /libavformat/hlsenc.c
parent0e49118271ce0a3e8911200824032508b5a7de16 (diff)
downloadffmpeg-f1ccb4dbcf0b878120ba3990476ce7059ead2d74.tar.gz
lavf/hlsenc: use ff_get_chomp_line
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 8eb84212a0..01a06d8b26 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -696,14 +696,6 @@ static int hls_encryption_start(AVFormatContext *s)
return 0;
}
-static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
-{
- int len = ff_get_line(s, buf, maxlen);
- while (len > 0 && av_isspace(buf[len - 1]))
- buf[--len] = '\0';
- return len;
-}
-
static int hls_mux_init(AVFormatContext *s, VariantStream *vs)
{
AVDictionary *options = NULL;
@@ -1072,7 +1064,7 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs
s->protocol_whitelist, s->protocol_blacklist)) < 0)
return ret;
- read_chomp_line(in, line, sizeof(line));
+ ff_get_chomp_line(in, line, sizeof(line));
if (strcmp(line, "#EXTM3U")) {
ret = AVERROR_INVALIDDATA;
goto fail;
@@ -1080,7 +1072,7 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs
vs->discontinuity = 0;
while (!avio_feof(in)) {
- read_chomp_line(in, line, sizeof(line));
+ ff_get_chomp_line(in, line, sizeof(line));
if (av_strstart(line, "#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
int64_t tmp_sequence = strtoll(ptr, NULL, 10);
if (tmp_sequence < vs->sequence)