mirror of
https://github.com/mpv-player/mpv
synced 2024-09-05 02:48:21 +02:00
(nicer) endianness fix for every plugin except pl_format
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8742 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9b483e615e
commit
c619dbbb5b
@ -9,6 +9,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "../config.h" /* for native endianness */
|
||||
|
||||
/* standard, old OSS audio formats */
|
||||
#ifndef AFMT_MU_LAW
|
||||
# define AFMT_MU_LAW 0x00000001
|
||||
|
@ -122,7 +122,7 @@ static int init(){
|
||||
float F[KM] = CF;
|
||||
|
||||
// Check input format
|
||||
if(ao_plugin_data.format != AFMT_S16_LE){
|
||||
if(ao_plugin_data.format != AFMT_S16_NE){
|
||||
fprintf(stderr,"[pl_eq] Input audio format not yet supported. \n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "audio_plugin.h"
|
||||
#include "audio_plugin_internal.h"
|
||||
#include "afmt.h"
|
||||
#include "../config.h"
|
||||
|
||||
static ao_info_t info = {
|
||||
"Extra stereo plugin",
|
||||
@ -58,11 +57,7 @@ static int control(int cmd,int arg){
|
||||
// return: 1=success 0=fail
|
||||
static int init(){
|
||||
switch(ao_plugin_data.format){
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
case(AFMT_S16_LE):
|
||||
#else
|
||||
case(AFMT_S16_BE):
|
||||
#endif
|
||||
case(AFMT_S16_NE):
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[pl_extrastereo] Audio format not yet suported \n");
|
||||
@ -92,11 +87,7 @@ static void reset(){
|
||||
static int play(){
|
||||
|
||||
switch(pl_extrastereo.format){
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
case(AFMT_S16_LE): {
|
||||
#else
|
||||
case(AFMT_S16_BE): {
|
||||
#endif
|
||||
case(AFMT_S16_NE): {
|
||||
|
||||
int16_t* data=(int16_t*)ao_plugin_data.data;
|
||||
int len=ao_plugin_data.len / 2; // 16 bits samples
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "audio_plugin.h"
|
||||
#include "audio_plugin_internal.h"
|
||||
#include "afmt.h"
|
||||
#include "../config.h"
|
||||
|
||||
static ao_info_t info =
|
||||
{
|
||||
@ -120,11 +119,7 @@ static int init(){
|
||||
pl_resample.up=UP;
|
||||
|
||||
// Sheck input format
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
if(ao_plugin_data.format != AFMT_S16_LE){
|
||||
#else
|
||||
if(ao_plugin_data.format != AFMT_S16_BE){
|
||||
#endif
|
||||
if(ao_plugin_data.format != AFMT_S16_NE){
|
||||
fprintf(stderr,"[pl_resample] Input audio format not yet suported. \n");
|
||||
return 0;
|
||||
}
|
||||
|
@ -108,8 +108,8 @@ static int init(){
|
||||
pl_surround.passthrough = 1;
|
||||
return 1;
|
||||
}
|
||||
if (ao_plugin_data.format != AFMT_S16_LE) {
|
||||
fprintf(stderr, "pl_surround: I'm dumb and can only handle AFMT_S16_LE audio format, using passthrough mode\n");
|
||||
if (ao_plugin_data.format != AFMT_S16_NE) {
|
||||
fprintf(stderr, "pl_surround: I'm dumb and can only handle AFMT_S16_NE audio format, using passthrough mode\n");
|
||||
pl_surround.passthrough = 1;
|
||||
return 1;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "audio_plugin.h"
|
||||
#include "audio_plugin_internal.h"
|
||||
#include "afmt.h"
|
||||
#include "../config.h"
|
||||
|
||||
static ao_info_t info = {
|
||||
"Volume normalizer",
|
||||
@ -117,11 +116,7 @@ static int control(int cmd,int arg){
|
||||
// return: 1=success 0=fail
|
||||
static int init(){
|
||||
switch(ao_plugin_data.format){
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
case(AFMT_S16_LE):
|
||||
#else
|
||||
case(AFMT_S16_BE):
|
||||
#endif
|
||||
case(AFMT_S16_NE):
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[pl_volnorm] Audio format not yet supported.\n");
|
||||
@ -147,11 +142,7 @@ static void reset(){
|
||||
int i;
|
||||
mul = MUL_INIT;
|
||||
switch(ao_plugin_data.format) {
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
case(AFMT_S16_LE):
|
||||
#else
|
||||
case(AFMT_S16_BE):
|
||||
#endif
|
||||
case(AFMT_S16_NE):
|
||||
#if AVG==1
|
||||
lastavg = MID_S16;
|
||||
#elif AVG==2
|
||||
@ -174,11 +165,7 @@ static void reset(){
|
||||
static int play(){
|
||||
|
||||
switch(pl_volnorm.format){
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
case(AFMT_S16_LE): {
|
||||
#else
|
||||
case(AFMT_S16_BE): {
|
||||
#endif
|
||||
case(AFMT_S16_NE): {
|
||||
#define CLAMP(x,m,M) do { if ((x)<(m)) (x) = (m); else if ((x)>(M)) (x) = (M); } while(0)
|
||||
|
||||
int16_t* data=(int16_t*)ao_plugin_data.data;
|
||||
|
@ -81,7 +81,7 @@ static int init(){
|
||||
// Sanity sheck this plugin supports AFMT_U8 and AFMT_S16_LE
|
||||
switch(ao_plugin_data.format){
|
||||
case(AFMT_U8):
|
||||
case(AFMT_S16_LE):
|
||||
case(AFMT_S16_NE):
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[pl_volume] Audio format not yet suported \n");
|
||||
@ -135,7 +135,7 @@ static int play(){
|
||||
}
|
||||
break;
|
||||
}
|
||||
case(AFMT_S16_LE):{
|
||||
case(AFMT_S16_NE):{
|
||||
register int len=ao_plugin_data.len>>1;
|
||||
register int16_t* data=(int16_t*)ao_plugin_data.data;
|
||||
register int x;
|
||||
|
Loading…
Reference in New Issue
Block a user