[gst-cvs] gst-plugins-bad: qtmux: use helper to set atom flags from given uint

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Fri Nov 19 10:24:28 PST 2010


Module: gst-plugins-bad
Branch: master
Commit: bd46298ca6384f5678ebe0a7b5b1144d741d6221
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=bd46298ca6384f5678ebe0a7b5b1144d741d6221

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Mon Nov 15 15:12:45 2010 +0100

qtmux: use helper to set atom flags from given uint

---

 gst/qtmux/atoms.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c
index 89f47ee..b7b4a8c 100644
--- a/gst/qtmux/atoms.c
+++ b/gst/qtmux/atoms.c
@@ -130,6 +130,14 @@ atom_full_free (AtomFull * full)
   g_free (full);
 }
 
+static void
+atom_full_set_flags_as_uint (AtomFull * full, guint32 flags_as_uint)
+{
+  full->flags[2] = flags_as_uint & 0xFF;
+  full->flags[1] = (flags_as_uint & 0xFF00) >> 8;
+  full->flags[0] = (flags_as_uint & 0xFF0000) >> 16;
+}
+
 static AtomInfo *
 build_atom_info_wrapper (Atom * atom, gpointer copy_func, gpointer free_func)
 {
@@ -1134,9 +1142,7 @@ atom_tag_new (guint32 fourcc, guint32 flags_as_uint)
 
   tag->header.type = fourcc;
   atom_tag_data_init (&tag->data);
-  tag->data.header.flags[2] = flags_as_uint & 0xFF;
-  tag->data.header.flags[1] = (flags_as_uint & 0xFF00) >> 8;
-  tag->data.header.flags[0] = (flags_as_uint & 0xFF0000) >> 16;
+  atom_full_set_flags_as_uint (&tag->data.header, flags_as_uint);
   return tag;
 }
 





More information about the Gstreamer-commits mailing list