From f22494b6fe280cd789e3b3db210f963afc6cbf3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 26 Mar 2009 13:20:18 +0100 Subject: [PATCH] mxf: Use mxf_u{l,uid}_is_equal() and friends instead of memcmp() --- gst/mxf/mxfaes-bwf.c | 12 ++++++------ gst/mxf/mxfdemux.c | 2 +- gst/mxf/mxfdv-dif.c | 7 ++++--- gst/mxf/mxfvc3.c | 9 +++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/gst/mxf/mxfaes-bwf.c b/gst/mxf/mxfaes-bwf.c index 8c93febd03..d8862d75b6 100644 --- a/gst/mxf/mxfaes-bwf.c +++ b/gst/mxf/mxfaes-bwf.c @@ -1183,8 +1183,8 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track, /* FIXME: set a channel layout */ if (mxf_ul_is_zero (&descriptor->sound_essence_compression) || - mxf_ul_is_equal (&descriptor->sound_essence_compression, - &mxf_sound_essence_compression_uncompressed)) { + mxf_ul_is_subclass (&mxf_sound_essence_compression_uncompressed, + &descriptor->sound_essence_compression)) { guint block_align; if (descriptor->channel_count == 0 || @@ -1212,8 +1212,8 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track, codec_name = g_strdup_printf ("Uncompressed %u-bit little endian integer PCM audio", (block_align / descriptor->channel_count) * 8); - } else if (mxf_ul_is_equal (&descriptor->sound_essence_compression, - &mxf_sound_essence_compression_aiff)) { + } else if (mxf_ul_is_subclass (&mxf_sound_essence_compression_aiff, + &descriptor->sound_essence_compression)) { guint block_align; if (descriptor->channel_count == 0 || @@ -1242,8 +1242,8 @@ mxf_bwf_create_caps (MXFMetadataTimelineTrack * track, codec_name = g_strdup_printf ("Uncompressed %u-bit big endian integer PCM audio", (block_align / descriptor->channel_count) * 8); - } else if (mxf_ul_is_equal (&descriptor->sound_essence_compression, - &mxf_sound_essence_compression_alaw)) { + } else if (mxf_ul_is_subclass (&mxf_sound_essence_compression_alaw, + &descriptor->sound_essence_compression)) { if (descriptor->audio_sampling_rate.n != 0 || descriptor->audio_sampling_rate.d != 0 || diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 1333135e53..b3af7919dd 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -659,7 +659,7 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux) } done: - if (memcmp (&ret->package_uid, &demux->current_package_uid, 32) != 0) { + if (mxf_umid_is_equal (&ret->package_uid, &demux->current_package_uid)) { gchar current_package_string[96]; GstTagList *tags = gst_tag_list_new (); diff --git a/gst/mxf/mxfdv-dif.c b/gst/mxf/mxfdv-dif.c index 9e7225320c..a239958d58 100644 --- a/gst/mxf/mxfdv-dif.c +++ b/gst/mxf/mxfdv-dif.c @@ -42,8 +42,9 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug); #define GST_CAT_DEFAULT mxf_debug -static const guint8 picture_essence_coding_dv[13] = { - 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01, 0x02, 0x02, 0x02 +static const MXFUL picture_essence_coding_dv = { { + 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x04, 0x01, 0x02, 0x02, + 0x02} }; static gboolean @@ -76,7 +77,7 @@ mxf_is_dv_dif_essence_track (const MXFMetadataTimelineTrack * track) p = MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (d); key = &p->picture_essence_coding; - if (memcmp (key, &picture_essence_coding_dv, 13) == 0) + if (mxf_ul_is_subclass (&picture_essence_coding_dv, key)) return TRUE; } } diff --git a/gst/mxf/mxfvc3.c b/gst/mxf/mxfvc3.c index 4c0c66922b..e4136d17cc 100644 --- a/gst/mxf/mxfvc3.c +++ b/gst/mxf/mxfvc3.c @@ -35,9 +35,10 @@ GST_DEBUG_CATEGORY_EXTERN (mxf_debug); #define GST_CAT_DEFAULT mxf_debug -static const guint8 picture_essence_coding_vc3_avid[] = { - 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x04, 0x02, 0x01, 0x02, - 0x04, 0x01, 0x00 +static const MXFUL picture_essence_coding_vc3_avid = { { + 0x06, 0x0e, 0x2b, 0x34, 0x04, 0x01, 0x01, 0x01, 0x0e, 0x04, 0x02, 0x01, + 0x02, + 0x04, 0x01, 0x00} }; static gboolean @@ -71,7 +72,7 @@ mxf_is_vc3_essence_track (const MXFMetadataTimelineTrack * track) p = MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (d); key = &p->picture_essence_coding; - if (memcmp (key, picture_essence_coding_vc3_avid, 16) == 0) + if (mxf_ul_is_subclass (&picture_essence_coding_vc3_avid, key)) return TRUE; } }