On Sun, 29 Jan 2017, Peter Große wrote:

Signed-off-by: Peter Große <[email protected]>
---
v2: add metadata field to AdaptionSet here
---
libavformat/dashenc.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index a0ea9a6..4116fc8 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -61,6 +61,7 @@ typedef struct Segment {
typedef struct AdaptationSet {
    char id[10];
    enum AVMediaType media_type;
+    AVDictionary *metadata;
} AdaptationSet;

typedef struct OutputStream {
@@ -186,6 +187,10 @@ static void dash_free(AVFormatContext *s)
    int i, j;

    if (c->as) {
+        for (i = 0; i < c->nb_as; i++) {
+            if (&c->as[i].metadata)
+                av_dict_free(&c->as[i].metadata);
+        }

Here, clang tells me:

libavformat/dashenc.c:204:27: warning: address of
      'c->as[i].metadata' will always evaluate to 'true'
      [-Wpointer-bool-conversion]
            if (&c->as[i].metadata)
            ~~   ~~~~~~~~~^~~~~~~~

In fact, we don't need to check whether we have any metadata before calling av_dict_free. Simplified.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to