qtmux: Use existing helper function to create "und" language code
authorSebastian Dröge <sebastian@centricular.com>
Thu, 6 Sep 2018 17:06:10 +0000 (20:06 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 6 Sep 2018 17:07:57 +0000 (20:07 +0300)
gst/isomp4/atoms.c
gst/isomp4/gstqtmux.c

index aa81dbc..8e53eab 100644 (file)
@@ -1154,8 +1154,7 @@ atom_mdhd_init (AtomMDHD * mdhd)
   /* tempting as it may be to simply 0-initialize,
    * that will have the demuxer (correctly) come up with 'eng' as language
    * so explicitly specify undefined instead */
-  mdhd->language_code =
-      ('u' - 0x60) * 0x400 + ('n' - 0x60) * 0x20 + ('d' - 0x60);
+  mdhd->language_code = language_code ("und");
   mdhd->quality = 0;
 }
 
index cf8148d..fafd94b 100644 (file)
@@ -6153,9 +6153,7 @@ gst_qt_mux_sink_event (GstCollectPads * pads, GstCollectData * data,
           g_assert (qtpad);
           if (qtpad->trak) {
             /* https://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html */
-            qtpad->trak->mdia.mdhd.language_code =
-                (iso_code[0] - 0x60) * 0x400 + (iso_code[1] - 0x60) * 0x20 +
-                (iso_code[2] - 0x60);
+            qtpad->trak->mdia.mdhd.language_code = language_code (iso_code);
           }
         }
         g_free (code);