diff mbox

[FFmpeg-devel,1/3] lavf/matroskaenc: move skipped metadata keys to separate function

Message ID 20160906032628.71847-1-rodger.combs@gmail.com
State Accepted
Commit 6ede4e93ca0468dc1645677ad540f575c941ff7a
Headers show

Commit Message

Rodger Combs Sept. 6, 2016, 3:26 a.m. UTC
---
 libavformat/matroskaenc.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

Comments

Michael Niedermayer Sept. 6, 2016, 8:33 p.m. UTC | #1
On Mon, Sep 05, 2016 at 10:26:26PM -0500, Rodger Combs wrote:
> ---
>  libavformat/matroskaenc.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)

LGTM

thx

[...]
diff mbox

Patch

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 2a2877f..decb66d 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1308,6 +1308,16 @@  static int mkv_write_tag_targets(AVFormatContext *s,
     return 0;
 }
 
+static int mkv_check_tag_name(const char *name, unsigned int elementid)
+{
+    return av_strcasecmp(name, "title") &&
+           av_strcasecmp(name, "stereo_mode") &&
+           av_strcasecmp(name, "creation_time") &&
+           av_strcasecmp(name, "encoding_tool") &&
+           (elementid != MATROSKA_ID_TAGTARGETS_TRACKUID ||
+            av_strcasecmp(name, "language"));
+}
+
 static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int elementid,
                          unsigned int uid, ebml_master *tags)
 {
@@ -1320,12 +1330,7 @@  static int mkv_write_tag(AVFormatContext *s, AVDictionary *m, unsigned int eleme
         return ret;
 
     while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) {
-        if (av_strcasecmp(t->key, "title") &&
-            av_strcasecmp(t->key, "stereo_mode") &&
-            av_strcasecmp(t->key, "creation_time") &&
-            av_strcasecmp(t->key, "encoding_tool") &&
-            (elementid != MATROSKA_ID_TAGTARGETS_TRACKUID ||
-             av_strcasecmp(t->key, "language"))) {
+        if (mkv_check_tag_name(t->key, elementid)) {
             ret = mkv_write_simpletag(s->pb, t);
             if (ret < 0)
                 return ret;