comparison pcm.c @ 12171:77b51328fc59 libavcodec

Use designated initialisers for pcm codec struct
author pross
date Fri, 16 Jul 2010 13:02:48 +0000
parents a12d8bdd0cac
children dde20597f15e
comparison
equal deleted inserted replaced
12170:6f0db2eeaf70 12171:77b51328fc59
442 *data_size = (uint8_t *)samples - (uint8_t *)data; 442 *data_size = (uint8_t *)samples - (uint8_t *)data;
443 return src - buf; 443 return src - buf;
444 } 444 }
445 445
446 #if CONFIG_ENCODERS 446 #if CONFIG_ENCODERS
447 #define PCM_ENCODER(id,sample_fmt_,name,long_name_) \ 447 #define PCM_ENCODER(id_,sample_fmt_,name_,long_name_) \
448 AVCodec name ## _encoder = { \ 448 AVCodec name_ ## _encoder = { \
449 #name, \ 449 .name = #name_, \
450 AVMEDIA_TYPE_AUDIO, \ 450 .type = AVMEDIA_TYPE_AUDIO, \
451 id, \ 451 .id = id_, \
452 0, \ 452 .init = pcm_encode_init, \
453 pcm_encode_init, \ 453 .encode = pcm_encode_frame, \
454 pcm_encode_frame, \ 454 .close = pcm_encode_close, \
455 pcm_encode_close, \
456 NULL, \
457 .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \ 455 .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
458 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ 456 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
459 }; 457 };
460 #else 458 #else
461 #define PCM_ENCODER(id,sample_fmt_,name,long_name_) 459 #define PCM_ENCODER(id,sample_fmt_,name,long_name_)
462 #endif 460 #endif
463 461
464 #if CONFIG_DECODERS 462 #if CONFIG_DECODERS
465 #define PCM_DECODER(id,sample_fmt_,name,long_name_) \ 463 #define PCM_DECODER(id_,sample_fmt_,name_,long_name_) \
466 AVCodec name ## _decoder = { \ 464 AVCodec name_ ## _decoder = { \
467 #name, \ 465 .name = #name_, \
468 AVMEDIA_TYPE_AUDIO, \ 466 .type = AVMEDIA_TYPE_AUDIO, \
469 id, \ 467 .id = id_, \
470 sizeof(PCMDecode), \ 468 .priv_data_size = sizeof(PCMDecode), \
471 pcm_decode_init, \ 469 .init = pcm_decode_init, \
472 NULL, \ 470 .decode = pcm_decode_frame, \
473 NULL, \
474 pcm_decode_frame, \
475 .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \ 471 .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
476 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \ 472 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
477 }; 473 };
478 #else 474 #else
479 #define PCM_DECODER(id,sample_fmt_,name,long_name_) 475 #define PCM_DECODER(id,sample_fmt_,name,long_name_)