Browse code

Modify all codecs to report their supported input and output sample format(s).

Originally committed as revision 14482 to svn://svn.ffmpeg.org/ffmpeg/trunk

Peter Ross authored on 2008/07/31 19:47:31
Showing 46 changed files
... ...
@@ -86,6 +86,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
86 86
         default:
87 87
           return -1;
88 88
     }
89
+    avctx->sample_fmt = SAMPLE_FMT_S16;
89 90
     return 0;
90 91
 }
91 92
 
... ...
@@ -221,6 +221,7 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
221 221
             return AVERROR_NOMEM;
222 222
     }
223 223
 
224
+    avctx->sample_fmt = SAMPLE_FMT_S16;
224 225
     return 0;
225 226
 }
226 227
 
... ...
@@ -1364,5 +1364,6 @@ AVCodec ac3_encoder = {
1364 1364
     AC3_encode_frame,
1365 1365
     AC3_encode_close,
1366 1366
     NULL,
1367
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
1367 1368
     .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"),
1368 1369
 };
... ...
@@ -698,6 +698,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
698 698
     default:
699 699
         break;
700 700
     }
701
+    avctx->sample_fmt = SAMPLE_FMT_S16;
701 702
     return 0;
702 703
 }
703 704
 
... ...
@@ -1599,6 +1600,7 @@ AVCodec name ## _encoder = {                    \
1599 1599
     adpcm_encode_frame,                         \
1600 1600
     adpcm_encode_close,                         \
1601 1601
     NULL,                                       \
1602
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
1602 1603
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
1603 1604
 };
1604 1605
 #else
... ...
@@ -30,6 +30,12 @@
30 30
  * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
31 31
  */
32 32
 
33
+static av_cold void adx_decode_init(AVCodecContext *avctx)
34
+{
35
+    avctx->sample_fmt = SAMPLE_FMT_S16;
36
+    return 0;
37
+}
38
+
33 39
 /* 18 bytes <-> 32 samples */
34 40
 
35 41
 static void adx_decode(short *out,const unsigned char *in,PREV *prev)
... ...
@@ -161,7 +167,7 @@ AVCodec adpcm_adx_decoder = {
161 161
     CODEC_TYPE_AUDIO,
162 162
     CODEC_ID_ADPCM_ADX,
163 163
     sizeof(ADXContext),
164
-    NULL,
164
+    adx_decode_init,
165 165
     NULL,
166 166
     NULL,
167 167
     adx_decode_frame,
... ...
@@ -190,5 +190,6 @@ AVCodec adpcm_adx_encoder = {
190 190
     adx_encode_frame,
191 191
     adx_encode_close,
192 192
     NULL,
193
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
193 194
     .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"),
194 195
 };
... ...
@@ -594,6 +594,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
594 594
 
595 595
     alac->numchannels = alac->avctx->channels;
596 596
     alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels;
597
+    avctx->sample_fmt = SAMPLE_FMT_S16;
597 598
 
598 599
     return 0;
599 600
 }
... ...
@@ -198,6 +198,7 @@ static av_cold int ape_decode_init(AVCodecContext * avctx)
198 198
     }
199 199
 
200 200
     dsputil_init(&s->dsp, avctx);
201
+    avctx->sample_fmt = SAMPLE_FMT_S16;
201 202
     return 0;
202 203
 }
203 204
 
... ...
@@ -1058,6 +1058,7 @@ static int atrac3_decode_init(AVCodecContext *avctx)
1058 1058
         return AVERROR(ENOMEM);
1059 1059
     }
1060 1060
 
1061
+    avctx->sample_fmt = SAMPLE_FMT_S16;
1061 1062
     return 0;
1062 1063
 }
1063 1064
 
... ...
@@ -1178,6 +1178,8 @@ static int cook_decode_init(AVCodecContext *avctx)
1178 1178
         return -1;
1179 1179
     }
1180 1180
 
1181
+    avctx->sample_fmt = SAMPLE_FMT_S16;
1182
+
1181 1183
 #ifdef COOKDEBUG
1182 1184
     dump_cook_context(q);
1183 1185
 #endif
... ...
@@ -1253,6 +1253,7 @@ static av_cold int dca_decode_init(AVCodecContext * avctx)
1253 1253
         avctx->channels = avctx->request_channels;
1254 1254
     }
1255 1255
 
1256
+    avctx->sample_fmt = SAMPLE_FMT_S16;
1256 1257
     return 0;
1257 1258
 }
1258 1259
 
... ...
@@ -154,6 +154,7 @@ static av_cold int dpcm_decode_init(AVCodecContext *avctx)
154 154
         break;
155 155
     }
156 156
 
157
+    avctx->sample_fmt = SAMPLE_FMT_S16;
157 158
     return 0;
158 159
 }
159 160
 
... ...
@@ -305,6 +305,7 @@ static av_cold int cinaudio_decode_init(AVCodecContext *avctx)
305 305
     cin->avctx = avctx;
306 306
     cin->initial_decode_frame = 1;
307 307
     cin->delta = 0;
308
+    avctx->sample_fmt = SAMPLE_FMT_S16;
308 309
 
309 310
     return 0;
310 311
 }
... ...
@@ -113,6 +113,7 @@ static av_cold int flac_decode_init(AVCodecContext * avctx)
113 113
         }
114 114
     }
115 115
 
116
+    avctx->sample_fmt = SAMPLE_FMT_S16;
116 117
     return 0;
117 118
 }
118 119
 
... ...
@@ -1485,5 +1485,6 @@ AVCodec flac_encoder = {
1485 1485
     flac_encode_close,
1486 1486
     NULL,
1487 1487
     .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
1488
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
1488 1489
     .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
1489 1490
 };
... ...
@@ -323,6 +323,9 @@ static av_cold int g726_init(AVCodecContext * avctx)
323 323
         return AVERROR(ENOMEM);
324 324
     avctx->coded_frame->key_frame = 1;
325 325
 
326
+    if (avctx->codec->decode)
327
+        avctx->sample_fmt = SAMPLE_FMT_S16;
328
+
326 329
     return 0;
327 330
 }
328 331
 
... ...
@@ -381,6 +384,7 @@ AVCodec adpcm_g726_encoder = {
381 381
     g726_encode_frame,
382 382
     g726_close,
383 383
     NULL,
384
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
384 385
     .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
385 386
 };
386 387
 #endif //CONFIG_ENCODERS
... ...
@@ -154,6 +154,7 @@ static av_cold int imc_decode_init(AVCodecContext * avctx)
154 154
 
155 155
     ff_fft_init(&q->fft, 7, 1);
156 156
     dsputil_init(&q->dsp, avctx);
157
+    avctx->sample_fmt = SAMPLE_FMT_S16;
157 158
     return 0;
158 159
 }
159 160
 
... ...
@@ -119,6 +119,7 @@ static av_cold int a52_decode_init(AVCodecContext *avctx)
119 119
         avctx->channels = avctx->request_channels;
120 120
     }
121 121
 
122
+    avctx->sample_fmt = SAMPLE_FMT_S16;
122 123
     return 0;
123 124
 }
124 125
 
... ...
@@ -134,6 +134,7 @@ static void amr_decode_fix_avctx(AVCodecContext * avctx)
134 134
     }
135 135
 
136 136
     avctx->frame_size = 160 * is_amr_wb;
137
+    avctx->sample_fmt = SAMPLE_FMT_S16;
137 138
 }
138 139
 
139 140
 #ifdef CONFIG_LIBAMR_NB_FIXED
... ...
@@ -516,6 +517,7 @@ AVCodec libamr_nb_encoder =
516 516
     amr_nb_encode_frame,
517 517
     amr_nb_encode_close,
518 518
     NULL,
519
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
519 520
     .long_name = NULL_IF_CONFIG_SMALL("libamr-nb Adaptive Multi-Rate (AMR) Narrow-Band"),
520 521
 };
521 522
 
... ...
@@ -710,6 +712,7 @@ AVCodec libamr_wb_encoder =
710 710
     amr_wb_encode_frame,
711 711
     amr_wb_encode_close,
712 712
     NULL,
713
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
713 714
     .long_name = NULL_IF_CONFIG_SMALL("libamr-wb Adaptive Multi-Rate (AMR) Wide-Band"),
714 715
 };
715 716
 
... ...
@@ -151,5 +151,6 @@ AVCodec libfaac_encoder = {
151 151
     Faac_encode_init,
152 152
     Faac_encode_frame,
153 153
     Faac_encode_close,
154
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
154 155
     .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
155 156
 };
... ...
@@ -313,6 +313,7 @@ static av_cold int faac_decode_init(AVCodecContext *avctx)
313 313
     if(!s->init && avctx->channels > 0)
314 314
         channel_setup(avctx);
315 315
 
316
+    avctx->sample_fmt = SAMPLE_FMT_S16;
316 317
     return 0;
317 318
 }
318 319
 
... ...
@@ -48,6 +48,8 @@ static av_cold int libgsm_init(AVCodecContext *avctx) {
48 48
 
49 49
         if(!avctx->sample_rate)
50 50
             avctx->sample_rate= 8000;
51
+
52
+        avctx->sample_fmt = SAMPLE_FMT_S16;
51 53
     }else{
52 54
         if (avctx->sample_rate != 8000) {
53 55
             av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
... ...
@@ -117,6 +119,7 @@ AVCodec libgsm_encoder = {
117 117
     libgsm_init,
118 118
     libgsm_encode_frame,
119 119
     libgsm_close,
120
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
120 121
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
121 122
 };
122 123
 
... ...
@@ -128,6 +131,7 @@ AVCodec libgsm_ms_encoder = {
128 128
     libgsm_init,
129 129
     libgsm_encode_frame,
130 130
     libgsm_close,
131
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
131 132
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
132 133
 };
133 134
 
... ...
@@ -218,5 +218,6 @@ AVCodec libmp3lame_encoder = {
218 218
     MP3lame_encode_frame,
219 219
     MP3lame_encode_close,
220 220
     .capabilities= CODEC_CAP_DELAY,
221
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
221 222
     .long_name= NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
222 223
 };
... ...
@@ -217,5 +217,6 @@ AVCodec libvorbis_encoder = {
217 217
     oggvorbis_encode_frame,
218 218
     oggvorbis_encode_close,
219 219
     .capabilities= CODEC_CAP_DELAY,
220
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
220 221
     .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
221 222
 } ;
... ...
@@ -396,6 +396,7 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
396 396
 {
397 397
     if (avctx->channels > 2)
398 398
         return -1;
399
+    avctx->sample_fmt = SAMPLE_FMT_S16;
399 400
     return 0;
400 401
 }
401 402
 
... ...
@@ -336,6 +336,7 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
336 336
     m->avctx = avctx;
337 337
     for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
338 338
         m->substream[substr].lossless_check_data = 0xffffffff;
339
+    avctx->sample_fmt = SAMPLE_FMT_S16;
339 340
     return 0;
340 341
 }
341 342
 
... ...
@@ -108,6 +108,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
108 108
         }
109 109
     }
110 110
     vlc_initialized = 1;
111
+    avctx->sample_fmt = SAMPLE_FMT_S16;
111 112
     return 0;
112 113
 }
113 114
 
... ...
@@ -177,6 +177,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
177 177
                  &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
178 178
     }
179 179
     vlc_initialized = 1;
180
+    avctx->sample_fmt = SAMPLE_FMT_S16;
180 181
     return 0;
181 182
 }
182 183
 
... ...
@@ -796,6 +796,7 @@ AVCodec mp2_encoder = {
796 796
     MPA_encode_frame,
797 797
     MPA_encode_close,
798 798
     NULL,
799
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
799 800
     .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
800 801
 };
801 802
 
... ...
@@ -149,6 +149,7 @@ static av_cold int decode_init(AVCodecContext * avctx) {
149 149
     if (!sine_window[0])
150 150
         ff_sine_window_init(sine_window, 128);
151 151
 
152
+    avctx->sample_fmt = SAMPLE_FMT_S16;
152 153
     return 0;
153 154
 }
154 155
 
... ...
@@ -553,7 +553,7 @@ static int pcm_decode_frame(AVCodecContext *avctx,
553 553
 }
554 554
 
555 555
 #ifdef CONFIG_ENCODERS
556
-#define PCM_ENCODER(id,name,long_name_)         \
556
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
557 557
 AVCodec name ## _encoder = {                    \
558 558
     #name,                                      \
559 559
     CODEC_TYPE_AUDIO,                           \
... ...
@@ -563,10 +563,11 @@ AVCodec name ## _encoder = {                    \
563 563
     pcm_encode_frame,                           \
564 564
     pcm_encode_close,                           \
565 565
     NULL,                                       \
566
+    .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
566 567
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
567 568
 };
568 569
 #else
569
-#define PCM_ENCODER(id,name,long_name_)
570
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
570 571
 #endif
571 572
 
572 573
 #ifdef CONFIG_DECODERS
... ...
@@ -586,28 +587,28 @@ AVCodec name ## _decoder = {                    \
586 586
 #define PCM_DECODER(id,name,long_name_)
587 587
 #endif
588 588
 
589
-#define PCM_CODEC(id, name, long_name_)         \
590
-    PCM_ENCODER(id,name,long_name_) PCM_DECODER(id,name,long_name_)
589
+#define PCM_CODEC(id, sample_fmt_, name, long_name_)         \
590
+    PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,name,long_name_)
591 591
 
592 592
 /* Note: Do not forget to add new entries to the Makefile as well. */
593
-PCM_CODEC  (CODEC_ID_PCM_ALAW, pcm_alaw, "A-law PCM");
594
-PCM_CODEC  (CODEC_ID_PCM_DVD, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
595
-PCM_CODEC  (CODEC_ID_PCM_F32BE, pcm_f32be, "32-bit floating point big-endian PCM");
596
-PCM_CODEC  (CODEC_ID_PCM_MULAW, pcm_mulaw, "mu-law PCM");
597
-PCM_CODEC  (CODEC_ID_PCM_S8, pcm_s8, "signed 8-bit PCM");
598
-PCM_CODEC  (CODEC_ID_PCM_S16BE, pcm_s16be, "signed 16-bit big-endian PCM");
599
-PCM_CODEC  (CODEC_ID_PCM_S16LE, pcm_s16le, "signed 16-bit little-endian PCM");
593
+PCM_CODEC  (CODEC_ID_PCM_ALAW,  SAMPLE_FMT_S16, pcm_alaw, "A-law PCM");
594
+PCM_CODEC  (CODEC_ID_PCM_DVD,   SAMPLE_FMT_S16, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
595
+PCM_CODEC  (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
596
+PCM_CODEC  (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
597
+PCM_CODEC  (CODEC_ID_PCM_S8,    SAMPLE_FMT_S16, pcm_s8, "signed 8-bit PCM");
598
+PCM_CODEC  (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-endian PCM");
599
+PCM_CODEC  (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "signed 16-bit little-endian PCM");
600 600
 PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, pcm_s16le_planar, "16-bit little-endian planar PCM");
601
-PCM_CODEC  (CODEC_ID_PCM_S24BE, pcm_s24be, "signed 24-bit big-endian PCM");
602
-PCM_CODEC  (CODEC_ID_PCM_S24DAUD, pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
603
-PCM_CODEC  (CODEC_ID_PCM_S24LE, pcm_s24le, "signed 24-bit little-endian PCM");
604
-PCM_CODEC  (CODEC_ID_PCM_S32BE, pcm_s32be, "signed 32-bit big-endian PCM");
605
-PCM_CODEC  (CODEC_ID_PCM_S32LE, pcm_s32le, "signed 32-bit little-endian PCM");
606
-PCM_CODEC  (CODEC_ID_PCM_U8, pcm_u8, "unsigned 8-bit PCM");
607
-PCM_CODEC  (CODEC_ID_PCM_U16BE, pcm_u16be, "unsigned 16-bit big-endian PCM");
608
-PCM_CODEC  (CODEC_ID_PCM_U16LE, pcm_u16le, "unsigned 16-bit little-endian PCM");
609
-PCM_CODEC  (CODEC_ID_PCM_U24BE, pcm_u24be, "unsigned 24-bit big-endian PCM");
610
-PCM_CODEC  (CODEC_ID_PCM_U24LE, pcm_u24le, "unsigned 24-bit little-endian PCM");
611
-PCM_CODEC  (CODEC_ID_PCM_U32BE, pcm_u32be, "unsigned 32-bit big-endian PCM");
612
-PCM_CODEC  (CODEC_ID_PCM_U32LE, pcm_u32le, "unsigned 32-bit little-endian PCM");
613
-PCM_CODEC  (CODEC_ID_PCM_ZORK, pcm_zork, "Zork PCM");
601
+PCM_CODEC  (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S16, pcm_s24be, "signed 24-bit big-endian PCM");
602
+PCM_CODEC  (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16,  pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
603
+PCM_CODEC  (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S16, pcm_s24le, "signed 24-bit little-endian PCM");
604
+PCM_CODEC  (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S16, pcm_s32be, "signed 32-bit big-endian PCM");
605
+PCM_CODEC  (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S16, pcm_s32le, "signed 32-bit little-endian PCM");
606
+PCM_CODEC  (CODEC_ID_PCM_U8,    SAMPLE_FMT_S16, pcm_u8, "unsigned 8-bit PCM");
607
+PCM_CODEC  (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-endian PCM");
608
+PCM_CODEC  (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "unsigned 16-bit little-endian PCM");
609
+PCM_CODEC  (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S16, pcm_u24be, "unsigned 24-bit big-endian PCM");
610
+PCM_CODEC  (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S16, pcm_u24le, "unsigned 24-bit little-endian PCM");
611
+PCM_CODEC  (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S16, pcm_u32be, "unsigned 32-bit big-endian PCM");
612
+PCM_CODEC  (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S16, pcm_u32le, "unsigned 32-bit little-endian PCM");
613
+PCM_CODEC  (CODEC_ID_PCM_ZORK,  SAMPLE_FMT_S16, pcm_zork, "Zork PCM");
... ...
@@ -1931,6 +1931,8 @@ static int qdm2_decode_init(AVCodecContext *avctx)
1931 1931
 
1932 1932
     qdm2_init(s);
1933 1933
 
1934
+    avctx->sample_fmt = SAMPLE_FMT_S16;
1935
+
1934 1936
 //    dump_context(s);
1935 1937
     return 0;
1936 1938
 }
... ...
@@ -58,6 +58,7 @@ static int ra144_decode_init(AVCodecContext * avctx)
58 58
     ractx->lpc_coef[0] = ractx->lpc_tables[0];
59 59
     ractx->lpc_coef[1] = ractx->lpc_tables[1];
60 60
 
61
+    avctx->sample_fmt = SAMPLE_FMT_S16;
61 62
     return 0;
62 63
 }
63 64
 
... ...
@@ -42,6 +42,12 @@ typedef struct {
42 42
     float gain_block[10];  ///< Gain data of four blocks (spec: GSTATE)
43 43
 } RA288Context;
44 44
 
45
+static av_cold int ra288_decode_init(AVCodecContext *avctx)
46
+{
47
+    avctx->sample_fmt = SAMPLE_FMT_S16;
48
+    return 0;
49
+}
50
+
45 51
 static inline float scalar_product_float(const float * v1, const float * v2,
46 52
                                          int size)
47 53
 {
... ...
@@ -258,7 +264,7 @@ AVCodec ra_288_decoder =
258 258
     CODEC_TYPE_AUDIO,
259 259
     CODEC_ID_RA_288,
260 260
     sizeof(RA288Context),
261
-    NULL,
261
+    ra288_decode_init,
262 262
     NULL,
263 263
     NULL,
264 264
     ra288_decode_frame,
... ...
@@ -174,5 +174,6 @@ AVCodec roq_dpcm_encoder = {
174 174
     roq_dpcm_encode_frame,
175 175
     roq_dpcm_encode_close,
176 176
     NULL,
177
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
177 178
     .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
178 179
 };
... ...
@@ -104,6 +104,7 @@ static av_cold int shorten_decode_init(AVCodecContext * avctx)
104 104
 {
105 105
     ShortenContext *s = avctx->priv_data;
106 106
     s->avctx = avctx;
107
+    avctx->sample_fmt = SAMPLE_FMT_S16;
107 108
 
108 109
     return 0;
109 110
 }
... ...
@@ -558,6 +558,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
558 558
 
559 559
 static av_cold int smka_decode_init(AVCodecContext *avctx)
560 560
 {
561
+    avctx->sample_fmt = SAMPLE_FMT_S16;
561 562
     return 0;
562 563
 }
563 564
 
... ...
@@ -828,6 +828,7 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
828 828
     }
829 829
     s->int_samples = av_mallocz(4* s->frame_size);
830 830
 
831
+    avctx->sample_fmt = SAMPLE_FMT_S16;
831 832
     return 0;
832 833
 }
833 834
 
... ...
@@ -54,6 +54,7 @@ static av_cold int truespeech_decode_init(AVCodecContext * avctx)
54 54
 {
55 55
 //    TSContext *c = avctx->priv_data;
56 56
 
57
+    avctx->sample_fmt = SAMPLE_FMT_S16;
57 58
     return 0;
58 59
 }
59 60
 
... ...
@@ -446,6 +446,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
446 446
     s->channels = avctx->channels;
447 447
     s->bits = avctx->bits_per_sample;
448 448
     s->block_align = avctx->block_align;
449
+    avctx->sample_fmt = SAMPLE_FMT_S16;
449 450
 
450 451
     av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
451 452
             s->channels, s->bits, s->block_align, avctx->sample_rate);
... ...
@@ -971,6 +971,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) {
971 971
     avccontext->channels = vc->audio_channels;
972 972
     avccontext->sample_rate = vc->audio_samplerate;
973 973
     avccontext->frame_size  = FFMIN(vc->blocksize[0], vc->blocksize[1])>>2;
974
+    avccontext->sample_fmt = SAMPLE_FMT_S16;
974 975
 
975 976
     return 0 ;
976 977
 }
... ...
@@ -1084,5 +1084,6 @@ AVCodec vorbis_encoder = {
1084 1084
     vorbis_encode_frame,
1085 1085
     vorbis_encode_close,
1086 1086
     .capabilities= CODEC_CAP_DELAY,
1087
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
1087 1088
     .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
1088 1089
 };
... ...
@@ -360,6 +360,7 @@ static av_cold int wavpack_decode_init(AVCodecContext *avctx)
360 360
 
361 361
     s->avctx = avctx;
362 362
     s->stereo = (avctx->channels == 2);
363
+    avctx->sample_fmt = SAMPLE_FMT_S16;
363 364
 
364 365
     return 0;
365 366
 }
... ...
@@ -126,6 +126,7 @@ static int wma_decode_init(AVCodecContext * avctx)
126 126
         wma_lsp_to_curve_init(s, s->frame_len);
127 127
     }
128 128
 
129
+    avctx->sample_fmt = SAMPLE_FMT_S16;
129 130
     return 0;
130 131
 }
131 132
 
... ...
@@ -387,6 +387,7 @@ AVCodec wmav1_encoder =
387 387
     encode_init,
388 388
     encode_superframe,
389 389
     ff_wma_end,
390
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
390 391
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
391 392
 };
392 393
 
... ...
@@ -399,5 +400,6 @@ AVCodec wmav2_encoder =
399 399
     encode_init,
400 400
     encode_superframe,
401 401
     ff_wma_end,
402
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
402 403
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
403 404
 };
... ...
@@ -40,6 +40,7 @@ static av_cold int ws_snd_decode_init(AVCodecContext * avctx)
40 40
 {
41 41
 //    WSSNDContext *c = avctx->priv_data;
42 42
 
43
+    avctx->sample_fmt = SAMPLE_FMT_S16;
43 44
     return 0;
44 45
 }
45 46