FileDescription is optional, don't write it if we're not given one.
authorNathan Caldwell <saintdev@gmail.com>
Tue, 13 Jan 2009 05:53:12 +0000 (12 22:53 -0700)
committerNathan Caldwell <saintdev@gmail.com>
Tue, 13 Jan 2009 05:53:12 +0000 (12 22:53 -0700)
src/attachments.c

index e9b1c27..4492c8a 100644 (file)
@@ -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 */