1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-15 11:25:10 +00:00
mpv/libaf/af_mp.c
anders 66f4e56389 New features:
-- Support for runtime cpu detection
-- Stand alone compile of libaf
-- Unlimited number of channels (compiletime switch)
-- Sample format defined by bit-fields
-- New formats: float, A-Law and mu-law
-- Format conversion set in human readable format
   i.e. format=4:us_be to set 32 bit unsigned big endian output
-- Format reporting in human readable format
-- Volume control has only one parameter for setting the volume
   i.e. volume=-10.0:1:0:1 to set atenuation = -10dB


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8168 b3059339-0415-0410-9bf9-f77b7e298cf2
2002-11-12 12:33:56 +00:00

42 lines
1.1 KiB
C

#include "af.h"
/* Decodes the format from mplayer format to libaf format */
int af_format_decode(int ifmt)
{
int ofmt = ~0;
// Check input ifmt
switch(ifmt){
case(AFMT_U8):
ofmt = AF_FORMAT_LE|AF_FORMAT_US; break;
case(AFMT_S8):
ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
case(AFMT_S16_LE):
ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
case(AFMT_S16_BE):
ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break;
case(AFMT_U16_LE):
ofmt = AF_FORMAT_LE|AF_FORMAT_US; break;
case(AFMT_U16_BE):
ofmt = AF_FORMAT_BE|AF_FORMAT_US; break;
case(AFMT_S32_LE):
ofmt = AF_FORMAT_LE|AF_FORMAT_SI; break;
case(AFMT_S32_BE):
ofmt = AF_FORMAT_BE|AF_FORMAT_SI; break;
case(AFMT_IMA_ADPCM):
ofmt = AF_FORMAT_IMA_ADPCM; break;
case(AFMT_MU_LAW):
ofmt = AF_FORMAT_MU_LAW; break;
case(AFMT_A_LAW):
ofmt = AF_FORMAT_A_LAW; break;
case(AFMT_MPEG):
ofmt = AF_FORMAT_MPEG2; break;
case(AFMT_AC3):
ofmt = AF_FORMAT_AC3; break;
default:
//This can not happen ....
af_msg(AF_MSG_FATAL,"Unrecognized input audio format %i\n",ifmt);
break;
}
return ofmt;
}