comparison mxf.c @ 2947:cdfb199be537 libavformat

cosmetics
author bcoudurier
date Sat, 19 Jan 2008 16:19:06 +0000
parents f90a2a21d5f6
children 787c0b2a2acb
comparison
equal deleted inserted replaced
2946:f90a2a21d5f6 2947:cdfb199be537
915 915
916 static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, int (*read_child)(), int ctx_size, enum MXFMetadataSetType type) 916 static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, int (*read_child)(), int ctx_size, enum MXFMetadataSetType type)
917 { 917 {
918 ByteIOContext *pb = mxf->fc->pb; 918 ByteIOContext *pb = mxf->fc->pb;
919 MXFMetadataSet *ctx = ctx_size ? av_mallocz(ctx_size) : mxf; 919 MXFMetadataSet *ctx = ctx_size ? av_mallocz(ctx_size) : mxf;
920 uint64_t klv_end= url_ftell(pb) + klv->length; 920 uint64_t klv_end = url_ftell(pb) + klv->length;
921 921
922 if (!ctx) 922 if (!ctx)
923 return -1; 923 return -1;
924 while (url_ftell(pb) + 4 < klv_end) { 924 while (url_ftell(pb) + 4 < klv_end) {
925 int tag = get_be16(pb); 925 int tag = get_be16(pb);
926 int size = get_be16(pb); /* KLV specified by 0x53 */ 926 int size = get_be16(pb); /* KLV specified by 0x53 */
927 uint64_t next= url_ftell(pb) + size; 927 uint64_t next = url_ftell(pb) + size;
928 UID uid; 928 UID uid;
929 929
930 if (!size) { /* ignore empty tag, needed for some files with empty UMID tag */ 930 if (!size) { /* ignore empty tag, needed for some files with empty UMID tag */
931 av_log(mxf->fc, AV_LOG_ERROR, "local tag 0x%04X with 0 size\n", tag); 931 av_log(mxf->fc, AV_LOG_ERROR, "local tag 0x%04X with 0 size\n", tag);
932 continue; 932 continue;
942 PRINT_KEY(mxf->fc, "uid", uid); 942 PRINT_KEY(mxf->fc, "uid", uid);
943 #endif 943 #endif
944 } 944 }
945 } 945 }
946 } 946 }
947 if(ctx_size && tag == 0x3C0A) 947 if (ctx_size && tag == 0x3C0A)
948 get_buffer(pb, ctx->uid, 16); 948 get_buffer(pb, ctx->uid, 16);
949 else 949 else
950 read_child(ctx, pb, tag, size, uid); 950 read_child(ctx, pb, tag, size, uid);
951 951
952 url_fseek(pb, next, SEEK_SET); 952 url_fseek(pb, next, SEEK_SET);