changeset 14815:56fb33e23ad4

If -af-adv force=4 is in effect, use ADCTRL_QUERY_FORMAT to query the ad codec about float support and set floatne format if supported.
author hzoli
date Fri, 25 Feb 2005 10:39:16 +0000
parents f022294269a8
children ca769ef8645e
files libmpcodecs/dec_audio.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/dec_audio.c	Fri Feb 25 10:21:14 2005 +0000
+++ b/libmpcodecs/dec_audio.c	Fri Feb 25 10:39:16 2005 +0000
@@ -49,6 +49,14 @@
 
 int init_audio_codec(sh_audio_t *sh_audio)
 {
+  if ((af_cfg.force & AF_INIT_FORMAT_MASK) == AF_INIT_FLOAT) {
+      int fmt = AF_FORMAT_FLOAT_NE;
+      if (mpadec->control(sh_audio, ADCTRL_QUERY_FORMAT,
+				       &fmt) == CONTROL_TRUE) {
+	  sh_audio->sample_format = fmt;
+	  sh_audio->samplesize = 4;
+      }
+  }
   if(!mpadec->preinit(sh_audio))
   {
       mp_msg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_ADecoderPreinitFailed);