From 77b10e61861dcf1e338aa4e7d6e98fabc7364198 Mon Sep 17 00:00:00 2001 From: Nathan Caldwell Date: Mon, 12 Jan 2009 22:53:12 -0700 Subject: [PATCH] FileDescription is optional, don't write it if we're not given one. --- src/attachments.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/attachments.c b/src/attachments.c index e9b1c27..4492c8a 100644 --- a/src/attachments.c +++ b/src/attachments.c @@ -51,8 +51,10 @@ int mk_createAttachment( /* FileName */ CHECK(mk_writeStr(attach, MATROSKA_ID_FILENAME, name)); - /* FileName */ - CHECK(mk_writeStr(attach, MATROSKA_ID_FILEDESCRIPTION, description)); + if ((description != NULL) && (strlen(description) > 0)) { + /* FileDescription */ + CHECK(mk_writeStr(attach, MATROSKA_ID_FILEDESCRIPTION, description)); + } /* FileMimeType */ CHECK(mk_writeStr(attach, MATROSKA_ID_FILEMIMETYPE, mime)); /* FileUID */ -- 2.11.4.GIT