[FFmpeg-cvslog] lavf/hls: use ff_get_chomp_line

Jun Zhao git at videolan.org
Thu Apr 12 11:10:10 EEST 2018


ffmpeg | branch: master | Jun Zhao <mypopydev at gmail.com> | Mon Apr  9 23:11:02 2018 +0800| [0e49118271ce0a3e8911200824032508b5a7de16] | committer: Jun Zhao

lavf/hls: use ff_get_chomp_line

Signed-off-by: Jun Zhao <mypopydev at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0e49118271ce0a3e8911200824032508b5a7de16
---

 libavformat/hls.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index ae0545a086..1257cd101c 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -216,14 +216,6 @@ typedef struct HLSContext {
     AVIOContext *playlist_pb;
 } HLSContext;
 
-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 void free_segment_list(struct playlist *pls)
 {
     int i;
@@ -770,7 +762,7 @@ static int parse_playlist(HLSContext *c, const char *url,
     if (av_opt_get(in, "location", AV_OPT_SEARCH_CHILDREN, &new_url) >= 0)
         url = new_url;
 
-    read_chomp_line(in, line, sizeof(line));
+    ff_get_chomp_line(in, line, sizeof(line));
     if (strcmp(line, "#EXTM3U")) {
         ret = AVERROR_INVALIDDATA;
         goto fail;
@@ -782,7 +774,7 @@ static int parse_playlist(HLSContext *c, const char *url,
         pls->type = PLS_TYPE_UNSPECIFIED;
     }
     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-STREAM-INF:", &ptr)) {
             is_variant = 1;
             memset(&variant_info, 0, sizeof(variant_info));



More information about the ffmpeg-cvslog mailing list