[SCM] libav/experimental: Use designated initialisers for pcm codec struct

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:11:25 UTC 2013


The following commit has been merged in the experimental branch:
commit a5b588bcad5b377f002147e5521809be79db7513
Author: Peter Ross <pross at xvid.org>
Date:   Fri Jul 16 13:02:48 2010 +0000

    Use designated initialisers for pcm codec struct
    
    Originally committed as revision 24264 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 4e86154..ba0f53a 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -444,16 +444,14 @@ static int pcm_decode_frame(AVCodecContext *avctx,
 }
 
 #if CONFIG_ENCODERS
-#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
-AVCodec name ## _encoder = {                    \
-    #name,                                      \
-    AVMEDIA_TYPE_AUDIO,                         \
-    id,                                         \
-    0,                                          \
-    pcm_encode_init,                            \
-    pcm_encode_frame,                           \
-    pcm_encode_close,                           \
-    NULL,                                       \
+#define PCM_ENCODER(id_,sample_fmt_,name_,long_name_) \
+AVCodec name_ ## _encoder = {                   \
+    .name        = #name_,                      \
+    .type        = AVMEDIA_TYPE_AUDIO,          \
+    .id          = id_,                         \
+    .init        = pcm_encode_init,             \
+    .encode      = pcm_encode_frame,            \
+    .close       = pcm_encode_close,            \
     .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
@@ -462,16 +460,14 @@ AVCodec name ## _encoder = {                    \
 #endif
 
 #if CONFIG_DECODERS
-#define PCM_DECODER(id,sample_fmt_,name,long_name_)         \
-AVCodec name ## _decoder = {                    \
-    #name,                                      \
-    AVMEDIA_TYPE_AUDIO,                         \
-    id,                                         \
-    sizeof(PCMDecode),                          \
-    pcm_decode_init,                            \
-    NULL,                                       \
-    NULL,                                       \
-    pcm_decode_frame,                           \
+#define PCM_DECODER(id_,sample_fmt_,name_,long_name_)         \
+AVCodec name_ ## _decoder = {                   \
+    .name           = #name_,                   \
+    .type           = AVMEDIA_TYPE_AUDIO,       \
+    .id             = id_,                      \
+    .priv_data_size = sizeof(PCMDecode),        \
+    .init           = pcm_decode_init,          \
+    .decode         = pcm_decode_frame,         \
     .sample_fmts = (const enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list