changeset 7451:85ab7655ad4d libavcodec

Modify all codecs to report their supported input and output sample format(s).
author pross
date Thu, 31 Jul 2008 10:47:31 +0000
parents 30d38a880fde
children 2240c6340eac
files 8svx.c ac3dec.c ac3enc.c adpcm.c adxdec.c adxenc.c alac.c apedec.c atrac3.c cook.c dca.c dpcm.c dsicinav.c flac.c flacenc.c g726.c imc.c liba52.c libamr.c libfaac.c libfaad.c libgsm.c libmp3lame.c libvorbis.c mace.c mlpdec.c mpc7.c mpc8.c mpegaudioenc.c nellymoserdec.c pcm.c qdm2.c ra144.c ra288.c roqaudioenc.c shorten.c smacker.c sonic.c truespeech.c vmdav.c vorbis_dec.c vorbis_enc.c wavpack.c wmadec.c wmaenc.c ws-snd1.c
diffstat 46 files changed, 94 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/8svx.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/8svx.c	Thu Jul 31 10:47:31 2008 +0000
@@ -86,6 +86,7 @@
         default:
           return -1;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/ac3dec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/ac3dec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -221,6 +221,7 @@
             return AVERROR_NOMEM;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/ac3enc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/ac3enc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1364,5 +1364,6 @@
     AC3_encode_frame,
     AC3_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52 / AC-3"),
 };
--- a/adpcm.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/adpcm.c	Thu Jul 31 10:47:31 2008 +0000
@@ -698,6 +698,7 @@
     default:
         break;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
@@ -1599,6 +1600,7 @@
     adpcm_encode_frame,                         \
     adpcm_encode_close,                         \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else
--- a/adxdec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/adxdec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -30,6 +30,12 @@
  * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/
  */
 
+static av_cold void adx_decode_init(AVCodecContext *avctx)
+{
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+    return 0;
+}
+
 /* 18 bytes <-> 32 samples */
 
 static void adx_decode(short *out,const unsigned char *in,PREV *prev)
@@ -161,7 +167,7 @@
     CODEC_TYPE_AUDIO,
     CODEC_ID_ADPCM_ADX,
     sizeof(ADXContext),
-    NULL,
+    adx_decode_init,
     NULL,
     NULL,
     adx_decode_frame,
--- a/adxenc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/adxenc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -190,5 +190,6 @@
     adx_encode_frame,
     adx_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"),
 };
--- a/alac.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/alac.c	Thu Jul 31 10:47:31 2008 +0000
@@ -594,6 +594,7 @@
 
     alac->numchannels = alac->avctx->channels;
     alac->bytespersample = (avctx->bits_per_sample / 8) * alac->numchannels;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
--- a/apedec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/apedec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -198,6 +198,7 @@
     }
 
     dsputil_init(&s->dsp, avctx);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/atrac3.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/atrac3.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1058,6 +1058,7 @@
         return AVERROR(ENOMEM);
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/cook.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/cook.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1178,6 +1178,8 @@
         return -1;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+
 #ifdef COOKDEBUG
     dump_cook_context(q);
 #endif
--- a/dca.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/dca.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1253,6 +1253,7 @@
         avctx->channels = avctx->request_channels;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/dpcm.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/dpcm.c	Thu Jul 31 10:47:31 2008 +0000
@@ -154,6 +154,7 @@
         break;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/dsicinav.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/dsicinav.c	Thu Jul 31 10:47:31 2008 +0000
@@ -305,6 +305,7 @@
     cin->avctx = avctx;
     cin->initial_decode_frame = 1;
     cin->delta = 0;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
--- a/flac.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/flac.c	Thu Jul 31 10:47:31 2008 +0000
@@ -113,6 +113,7 @@
         }
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/flacenc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/flacenc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1485,5 +1485,6 @@
     flac_encode_close,
     NULL,
     .capabilities = CODEC_CAP_SMALL_LAST_FRAME,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
 };
--- a/g726.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/g726.c	Thu Jul 31 10:47:31 2008 +0000
@@ -323,6 +323,9 @@
         return AVERROR(ENOMEM);
     avctx->coded_frame->key_frame = 1;
 
+    if (avctx->codec->decode)
+        avctx->sample_fmt = SAMPLE_FMT_S16;
+
     return 0;
 }
 
@@ -381,6 +384,7 @@
     g726_encode_frame,
     g726_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
 };
 #endif //CONFIG_ENCODERS
--- a/imc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/imc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -154,6 +154,7 @@
 
     ff_fft_init(&q->fft, 7, 1);
     dsputil_init(&q->dsp, avctx);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/liba52.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/liba52.c	Thu Jul 31 10:47:31 2008 +0000
@@ -119,6 +119,7 @@
         avctx->channels = avctx->request_channels;
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/libamr.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/libamr.c	Thu Jul 31 10:47:31 2008 +0000
@@ -134,6 +134,7 @@
     }
 
     avctx->frame_size = 160 * is_amr_wb;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 }
 
 #ifdef CONFIG_LIBAMR_NB_FIXED
@@ -516,6 +517,7 @@
     amr_nb_encode_frame,
     amr_nb_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libamr-nb Adaptive Multi-Rate (AMR) Narrow-Band"),
 };
 
@@ -710,6 +712,7 @@
     amr_wb_encode_frame,
     amr_wb_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libamr-wb Adaptive Multi-Rate (AMR) Wide-Band"),
 };
 
--- a/libfaac.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/libfaac.c	Thu Jul 31 10:47:31 2008 +0000
@@ -151,5 +151,6 @@
     Faac_encode_init,
     Faac_encode_frame,
     Faac_encode_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libfaac AAC (Advanced Audio Codec)"),
 };
--- a/libfaad.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/libfaad.c	Thu Jul 31 10:47:31 2008 +0000
@@ -313,6 +313,7 @@
     if(!s->init && avctx->channels > 0)
         channel_setup(avctx);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/libgsm.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/libgsm.c	Thu Jul 31 10:47:31 2008 +0000
@@ -48,6 +48,8 @@
 
         if(!avctx->sample_rate)
             avctx->sample_rate= 8000;
+
+        avctx->sample_fmt = SAMPLE_FMT_S16;
     }else{
         if (avctx->sample_rate != 8000) {
             av_log(avctx, AV_LOG_ERROR, "Sample rate 8000Hz required for GSM, got %dHz\n",
@@ -117,6 +119,7 @@
     libgsm_init,
     libgsm_encode_frame,
     libgsm_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM"),
 };
 
@@ -128,6 +131,7 @@
     libgsm_init,
     libgsm_encode_frame,
     libgsm_close,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("libgsm GSM Microsoft variant"),
 };
 
--- a/libmp3lame.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/libmp3lame.c	Thu Jul 31 10:47:31 2008 +0000
@@ -218,5 +218,6 @@
     MP3lame_encode_frame,
     MP3lame_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
 };
--- a/libvorbis.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/libvorbis.c	Thu Jul 31 10:47:31 2008 +0000
@@ -217,5 +217,6 @@
     oggvorbis_encode_frame,
     oggvorbis_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("libvorbis Vorbis"),
 } ;
--- a/mace.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/mace.c	Thu Jul 31 10:47:31 2008 +0000
@@ -396,6 +396,7 @@
 {
     if (avctx->channels > 2)
         return -1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/mlpdec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/mlpdec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -336,6 +336,7 @@
     m->avctx = avctx;
     for (substr = 0; substr < MAX_SUBSTREAMS; substr++)
         m->substream[substr].lossless_check_data = 0xffffffff;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/mpc7.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/mpc7.c	Thu Jul 31 10:47:31 2008 +0000
@@ -108,6 +108,7 @@
         }
     }
     vlc_initialized = 1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/mpc8.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/mpc8.c	Thu Jul 31 10:47:31 2008 +0000
@@ -177,6 +177,7 @@
                  &mpc8_q8_codes[i], 1, 1, INIT_VLC_USE_STATIC);
     }
     vlc_initialized = 1;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/mpegaudioenc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/mpegaudioenc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -796,6 +796,7 @@
     MPA_encode_frame,
     MPA_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
 };
 
--- a/nellymoserdec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/nellymoserdec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -149,6 +149,7 @@
     if (!sine_window[0])
         ff_sine_window_init(sine_window, 128);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/pcm.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/pcm.c	Thu Jul 31 10:47:31 2008 +0000
@@ -553,7 +553,7 @@
 }
 
 #ifdef CONFIG_ENCODERS
-#define PCM_ENCODER(id,name,long_name_)         \
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
 AVCodec name ## _encoder = {                    \
     #name,                                      \
     CODEC_TYPE_AUDIO,                           \
@@ -563,10 +563,11 @@
     pcm_encode_frame,                           \
     pcm_encode_close,                           \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else
-#define PCM_ENCODER(id,name,long_name_)
+#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
 #endif
 
 #ifdef CONFIG_DECODERS
@@ -586,28 +587,28 @@
 #define PCM_DECODER(id,name,long_name_)
 #endif
 
-#define PCM_CODEC(id, name, long_name_)         \
-    PCM_ENCODER(id,name,long_name_) PCM_DECODER(id,name,long_name_)
+#define PCM_CODEC(id, sample_fmt_, name, long_name_)         \
+    PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,name,long_name_)
 
 /* Note: Do not forget to add new entries to the Makefile as well. */
-PCM_CODEC  (CODEC_ID_PCM_ALAW, pcm_alaw, "A-law PCM");
-PCM_CODEC  (CODEC_ID_PCM_DVD, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_F32BE, pcm_f32be, "32-bit floating point big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_MULAW, pcm_mulaw, "mu-law PCM");
-PCM_CODEC  (CODEC_ID_PCM_S8, pcm_s8, "signed 8-bit PCM");
-PCM_CODEC  (CODEC_ID_PCM_S16BE, pcm_s16be, "signed 16-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S16LE, pcm_s16le, "signed 16-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_ALAW,  SAMPLE_FMT_S16, pcm_alaw, "A-law PCM");
+PCM_CODEC  (CODEC_ID_PCM_DVD,   SAMPLE_FMT_S16, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
+PCM_CODEC  (CODEC_ID_PCM_S8,    SAMPLE_FMT_S16, pcm_s8, "signed 8-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "signed 16-bit little-endian PCM");
 PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, pcm_s16le_planar, "16-bit little-endian planar PCM");
-PCM_CODEC  (CODEC_ID_PCM_S24BE, pcm_s24be, "signed 24-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S24DAUD, pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
-PCM_CODEC  (CODEC_ID_PCM_S24LE, pcm_s24le, "signed 24-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S32BE, pcm_s32be, "signed 32-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_S32LE, pcm_s32le, "signed 32-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U8, pcm_u8, "unsigned 8-bit PCM");
-PCM_CODEC  (CODEC_ID_PCM_U16BE, pcm_u16be, "unsigned 16-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U16LE, pcm_u16le, "unsigned 16-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U24BE, pcm_u24be, "unsigned 24-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U24LE, pcm_u24le, "unsigned 24-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U32BE, pcm_u32be, "unsigned 32-bit big-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_U32LE, pcm_u32le, "unsigned 32-bit little-endian PCM");
-PCM_CODEC  (CODEC_ID_PCM_ZORK, pcm_zork, "Zork PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S16, pcm_s24be, "signed 24-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16,  pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S16, pcm_s24le, "signed 24-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S16, pcm_s32be, "signed 32-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S16, pcm_s32le, "signed 32-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U8,    SAMPLE_FMT_S16, pcm_u8, "unsigned 8-bit PCM");
+PCM_CODEC  (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "unsigned 16-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S16, pcm_u24be, "unsigned 24-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S16, pcm_u24le, "unsigned 24-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S16, pcm_u32be, "unsigned 32-bit big-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S16, pcm_u32le, "unsigned 32-bit little-endian PCM");
+PCM_CODEC  (CODEC_ID_PCM_ZORK,  SAMPLE_FMT_S16, pcm_zork, "Zork PCM");
--- a/qdm2.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/qdm2.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1931,6 +1931,8 @@
 
     qdm2_init(s);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+
 //    dump_context(s);
     return 0;
 }
--- a/ra144.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/ra144.c	Thu Jul 31 10:47:31 2008 +0000
@@ -58,6 +58,7 @@
     ractx->lpc_coef[0] = ractx->lpc_tables[0];
     ractx->lpc_coef[1] = ractx->lpc_tables[1];
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/ra288.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/ra288.c	Thu Jul 31 10:47:31 2008 +0000
@@ -42,6 +42,12 @@
     float gain_block[10];  ///< Gain data of four blocks (spec: GSTATE)
 } RA288Context;
 
+static av_cold int ra288_decode_init(AVCodecContext *avctx)
+{
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+    return 0;
+}
+
 static inline float scalar_product_float(const float * v1, const float * v2,
                                          int size)
 {
@@ -258,7 +264,7 @@
     CODEC_TYPE_AUDIO,
     CODEC_ID_RA_288,
     sizeof(RA288Context),
-    NULL,
+    ra288_decode_init,
     NULL,
     NULL,
     ra288_decode_frame,
--- a/roqaudioenc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/roqaudioenc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -174,5 +174,6 @@
     roq_dpcm_encode_frame,
     roq_dpcm_encode_close,
     NULL,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("id RoQ DPCM"),
 };
--- a/shorten.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/shorten.c	Thu Jul 31 10:47:31 2008 +0000
@@ -104,6 +104,7 @@
 {
     ShortenContext *s = avctx->priv_data;
     s->avctx = avctx;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
--- a/smacker.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/smacker.c	Thu Jul 31 10:47:31 2008 +0000
@@ -558,6 +558,7 @@
 
 static av_cold int smka_decode_init(AVCodecContext *avctx)
 {
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/sonic.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/sonic.c	Thu Jul 31 10:47:31 2008 +0000
@@ -828,6 +828,7 @@
     }
     s->int_samples = av_mallocz(4* s->frame_size);
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/truespeech.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/truespeech.c	Thu Jul 31 10:47:31 2008 +0000
@@ -54,6 +54,7 @@
 {
 //    TSContext *c = avctx->priv_data;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/vmdav.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/vmdav.c	Thu Jul 31 10:47:31 2008 +0000
@@ -446,6 +446,7 @@
     s->channels = avctx->channels;
     s->bits = avctx->bits_per_sample;
     s->block_align = avctx->block_align;
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
             s->channels, s->bits, s->block_align, avctx->sample_rate);
--- a/vorbis_dec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/vorbis_dec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -971,6 +971,7 @@
     avccontext->channels = vc->audio_channels;
     avccontext->sample_rate = vc->audio_samplerate;
     avccontext->frame_size  = FFMIN(vc->blocksize[0], vc->blocksize[1])>>2;
+    avccontext->sample_fmt = SAMPLE_FMT_S16;
 
     return 0 ;
 }
--- a/vorbis_enc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/vorbis_enc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -1084,5 +1084,6 @@
     vorbis_encode_frame,
     vorbis_encode_close,
     .capabilities= CODEC_CAP_DELAY,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Vorbis"),
 };
--- a/wavpack.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/wavpack.c	Thu Jul 31 10:47:31 2008 +0000
@@ -360,6 +360,7 @@
 
     s->avctx = avctx;
     s->stereo = (avctx->channels == 2);
+    avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;
 }
--- a/wmadec.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/wmadec.c	Thu Jul 31 10:47:31 2008 +0000
@@ -126,6 +126,7 @@
         wma_lsp_to_curve_init(s, s->frame_len);
     }
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
--- a/wmaenc.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/wmaenc.c	Thu Jul 31 10:47:31 2008 +0000
@@ -387,6 +387,7 @@
     encode_init,
     encode_superframe,
     ff_wma_end,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 1"),
 };
 
@@ -399,5 +400,6 @@
     encode_init,
     encode_superframe,
     ff_wma_end,
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio 2"),
 };
--- a/ws-snd1.c	Wed Jul 30 18:21:51 2008 +0000
+++ b/ws-snd1.c	Thu Jul 31 10:47:31 2008 +0000
@@ -40,6 +40,7 @@
 {
 //    WSSNDContext *c = avctx->priv_data;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }