[PATCH] liba52 float stuff again
OK, here is an other cleaner attempt on float output support from liba52. The -a52float mplayer option is gone, float output must be requested by -af-adv force=4, and it would work for all ad_ modules which implement ADCTRL_QUERY_FORMAT and reports that it supports AF_FORMAT_FLOAT_NE. ADCTRL_QUERY_FORMAT was defined in ad.h but it hasn't been used anywhere bofore. I've modified dec_audio.c, if -af-adv force=4 is used, it calls ad->control(... ADCTRL_QUERY_FORMAT ...) before ad->preinit and if it reports float support, it sets the sample_format and samplesize before calling preinit. I've also added ADCTRL_SET_VOLUME support to liba52, which is inaccessible now, but perhaps later mixer.c could be changed to use it. And in preparation for that, I've added an ad_driver member into sh_audio_t, and I have removed the file-global mpadec variable from dec_audio.c in favor of sh_audio->ad_driver. This at least makes the ad driver available outside dec_audio.c, but mixer.c still cannot use it because it does not see sh_audio. A simple solution is to add an ad_driver member to mixer_t, and use that. Zoli
Zoltan Hidvegi wrote:
OK, here is an other cleaner attempt on float output support from liba52. The -a52float mplayer option is gone, float output must be requested by -af-adv force=4, and it would work for all ad_ modules which implement ADCTRL_QUERY_FORMAT and reports that it supports AF_FORMAT_FLOAT_NE. ADCTRL_QUERY_FORMAT was defined in ad.h but it hasn't been used anywhere bofore. I've modified dec_audio.c, if -af-adv force=4 is used, it calls ad->control(... ADCTRL_QUERY_FORMAT ...) before ad->preinit and if it reports float support, it sets the sample_format and samplesize before calling preinit.
I've also added ADCTRL_SET_VOLUME support to liba52, which is inaccessible now, but perhaps later mixer.c could be changed to use it. And in preparation for that, I've added an ad_driver member into sh_audio_t, and I have removed the file-global mpadec variable from dec_audio.c in favor of sh_audio->ad_driver. This at least makes the ad driver available outside dec_audio.c, but mixer.c still cannot use it because it does not see sh_audio. A simple solution is to add an ad_driver member to mixer_t, and use that.
Any comments on this? Is it OK to commit? Zoli
Hi,
OK, here is an other cleaner attempt on float output support from liba52. The -a52float mplayer option is gone, float output must be requested by -af-adv force=4, and it would work for all ad_ modules which implement ADCTRL_QUERY_FORMAT and reports that it supports AF_FORMAT_FLOAT_NE. ADCTRL_QUERY_FORMAT was defined in ad.h but it hasn't been used anywhere bofore. I've modified dec_audio.c, if -af-adv force=4 is used, it calls ad->control(... ADCTRL_QUERY_FORMAT ...) before ad->preinit and if it reports float support, it sets the sample_format and samplesize before calling preinit.
I've also added ADCTRL_SET_VOLUME support to liba52, which is inaccessible now, but perhaps later mixer.c could be changed to use it. And in preparation for that, I've added an ad_driver member into sh_audio_t, and I have removed the file-global mpadec variable from dec_audio.c in favor of sh_audio->ad_driver. This at least makes the ad driver available outside dec_audio.c, but mixer.c still cannot use it because it does not see sh_audio. A simple solution is to add an ad_driver member to mixer_t, and use that.
I would better split it into two patches, one regarding the QUERY_FORMAT in the framework (commit this first), and the second liba52 part. -- Alex Beregszaszi e-mail: alex@fsn.hu Free Software Network cell: +36 70 3144424
participants (2)
-
Alex Beregszaszi -
Zoltan Hidvegi