[FFmpeg-devel] [PATCH 05/19] avformat/hls: add some logging messages

Anssi Hannula anssi.hannula at iki.fi
Fri Jan 3 15:21:29 CET 2014


Signed-off-by: Anssi Hannula <anssi.hannula at iki.fi>
---

Already LGTM'd, not applied yet due to dependencies.

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

diff --git a/libavformat/hls.c b/libavformat/hls.c
index dcdbd79..42fbc3e 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -622,6 +622,9 @@ static int open_input(HLSContext *c, struct playlist *pls)
     av_dict_set(&opts, "headers", c->headers, 0);
     av_dict_set(&opts, "seekable", "0", 0);
 
+    av_log(pls->parent, AV_LOG_VERBOSE, "HLS request for url '%s', offset %"PRId64", playlist %d\n",
+           seg->url, seg->url_offset, pls->index);
+
     if (seg->key_type == KEY_NONE) {
         av_dict_copy(&opts, offset_opts, 0);
         ret = ffurl_open(&pls->input, seg->url, AVIO_FLAG_READ,
@@ -713,8 +716,11 @@ restart:
 reload:
         if (!v->finished &&
             av_gettime() - v->last_load_time >= reload_interval) {
-            if ((ret = parse_playlist(c, v->url, v, NULL)) < 0)
+            if ((ret = parse_playlist(c, v->url, v, NULL)) < 0) {
+                av_log(v->parent, AV_LOG_WARNING, "Failed to reload playlist %d\n",
+                       v->index);
                 return ret;
+            }
             /* If we need to reload the playlist again below (if
              * there's still no more segments), switch to a reload
              * interval of half the target duration. */
@@ -739,8 +745,11 @@ reload:
         }
 
         ret = open_input(c, v);
-        if (ret < 0)
+        if (ret < 0) {
+            av_log(v->parent, AV_LOG_WARNING, "Failed to open segment of playlist %d\n",
+                   v->index);
             return ret;
+        }
     }
     /* limit read if the segment was only a part of a file */
     seg = v->segments[v->cur_seq_no - v->start_seq_no];
-- 
1.8.1.5



More information about the ffmpeg-devel mailing list