[FFmpeg-cvslog] r9184 - trunk/libavformat/mxf.c

bcoudurier subversion
Sun Jun 3 16:52:55 CEST 2007


Author: bcoudurier
Date: Sun Jun  3 16:52:55 2007
New Revision: 9184

Log:
match uids indenpendantly of the version byte

Modified:
   trunk/libavformat/mxf.c

Modified: trunk/libavformat/mxf.c
==============================================================================
--- trunk/libavformat/mxf.c	(original)
+++ trunk/libavformat/mxf.c	Sun Jun  3 16:52:55 2007
@@ -637,10 +637,24 @@ static const MXFCodecUL mxf_sound_essenc
     { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },       CODEC_ID_NONE, Frame },
 };
 
+/*
+ * Match an uid independently of the version byte and up to len common bytes
+ * Returns: boolean
+ */
+static int mxf_match_uid(const UID key, const UID uid, int len)
+{
+    int i;
+    for (i = 0; i < len; i++) {
+        if (i != 7 && key[i] != uid[i])
+            return 0;
+    }
+    return 1;
+}
+
 static const MXFCodecUL *mxf_get_codec_ul(const MXFCodecUL *uls, UID *uid)
 {
     while (uls->id != CODEC_ID_NONE) {
-        if(!memcmp(uls->uid, *uid, 16))
+        if(mxf_match_uid(uls->uid, *uid, 16))
             break;
         uls++;
     }
@@ -650,7 +664,7 @@ static const MXFCodecUL *mxf_get_codec_u
 static enum CodecType mxf_get_codec_type(const MXFDataDefinitionUL *uls, UID *uid)
 {
     while (uls->type != CODEC_TYPE_DATA) {
-        if(!memcmp(uls->uid, *uid, 16))
+        if(mxf_match_uid(uls->uid, *uid, 16))
             break;
         uls++;
     }




More information about the ffmpeg-cvslog mailing list