[FFmpeg-devel] lavf/http: Print metadata updates with loglevel verbose

Submitted by Carl Eugen Hoyos on Feb. 10, 2019, 12:01 a.m.

Details

Message ID CAB0OVGonu0dm+WJbVm=GoW0wY6XJ69e08V_izWRED3ubCAtgXA@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Feb. 10, 2019, 12:01 a.m.
Hi!

Attached patch simplifies the debugging of icy metadata, required to
answer the tickets of one regular reporter.

Please comment, Carl Eugen

Comments

Carl Eugen Hoyos March 20, 2019, 4:44 p.m.
2019-02-10 1:01 GMT+01:00, Carl Eugen Hoyos <ceffmpeg@gmail.com>:

> Attached patch simplifies the debugging of icy metadata, required to
> answer the tickets of one regular reporter.

Patch applied.

Carl Eugen

Patch hide | download patch | download mbox

From 170f6bcf79b4486adf1121f7e5f01b6617fd1e79 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sun, 10 Feb 2019 00:59:30 +0100
Subject: [PATCH] lavf/http: Print metadata updates with -loglevel verbose.

Simplifies metadata debugging.
---
 libavformat/http.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index a0a0636..ee3ac23 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1504,12 +1504,13 @@  static int http_read_stream_all(URLContext *h, uint8_t *buf, int size)
     return pos;
 }
 
-static void update_metadata(HTTPContext *s, char *data)
+static void update_metadata(URLContext *h, char *data)
 {
     char *key;
     char *val;
     char *end;
     char *next = data;
+    HTTPContext *s = h->priv_data;
 
     while (*next) {
         key = next;
@@ -1525,6 +1526,7 @@  static void update_metadata(HTTPContext *s, char *data)
         val += 2;
 
         av_dict_set(&s->metadata, key, val, 0);
+        av_log(h, AV_LOG_VERBOSE, "Metadata update for %s: %s\n", key, val);
 
         next = end + 2;
     }
@@ -1559,7 +1561,7 @@  static int store_icy(URLContext *h, int size)
             data[len + 1] = 0;
             if ((ret = av_opt_set(s, "icy_metadata_packet", data, 0)) < 0)
                 return ret;
-            update_metadata(s, data);
+            update_metadata(h, data);
         }
         s->icy_data_read = 0;
         remaining        = s->icy_metaint;
-- 
1.7.10.4