comparison mxfenc.c @ 4404:7cf3b77ad6ff libavformat

reuse MXFCodecUL for data def and simplify
author bcoudurier
date Sun, 08 Feb 2009 05:12:30 +0000
parents 39f6b190c772
children b6b31de76359
comparison
equal deleted inserted replaced
4403:39f6b190c772 4404:7cf3b77ad6ff
323 AVStream *st = s->streams[i]; 323 AVStream *st = s->streams[i];
324 av_freep(&st->priv_data); 324 av_freep(&st->priv_data);
325 } 325 }
326 } 326 }
327 327
328 static const MXFDataDefinitionUL *mxf_get_data_definition_ul(enum CodecType type) 328 static const MXFCodecUL *mxf_get_data_definition_ul(int type)
329 { 329 {
330 const MXFDataDefinitionUL *uls = ff_mxf_data_definition_uls; 330 const MXFCodecUL *uls = ff_mxf_data_definition_uls;
331 while (uls->type != CODEC_TYPE_DATA) { 331 while (uls->uid[0]) {
332 if (type == uls->type) 332 if (type == uls->id)
333 break; 333 break;
334 uls++; 334 uls++;
335 } 335 }
336 return uls; 336 return uls;
337 } 337 }
507 mxf_write_uuid(pb, type == MaterialPackage ? Sequence: Sequence + TypeBottom, st->index); 507 mxf_write_uuid(pb, type == MaterialPackage ? Sequence: Sequence + TypeBottom, st->index);
508 } 508 }
509 509
510 static void mxf_write_common_fields(ByteIOContext *pb, AVStream *st) 510 static void mxf_write_common_fields(ByteIOContext *pb, AVStream *st)
511 { 511 {
512 const MXFDataDefinitionUL *data_def_ul = mxf_get_data_definition_ul(st->codec->codec_type); 512 const MXFCodecUL *data_def_ul = mxf_get_data_definition_ul(st->codec->codec_type);
513 MXFStreamContext *sc = st->priv_data; 513 MXFStreamContext *sc = st->priv_data;
514 514
515 // find data define uls 515 // find data define uls
516 mxf_write_local_tag(pb, 16, 0x0201); 516 mxf_write_local_tag(pb, 16, 0x0201);
517 put_buffer(pb, data_def_ul->uid, 16); 517 put_buffer(pb, data_def_ul->uid, 16);