diff options
author | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-31 08:03:51 +0000 |
---|---|---|
committer | anders <anders@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-10-31 08:03:51 +0000 |
commit | a72b161551062f97dca53a49e44f604124a3532b (patch) | |
tree | 1c7b34de3dfe3f7bd7134c7992254e98669e70ea /libaf/af.c | |
parent | aae530974747ffe340aa58e9785e9c56a2a29986 (diff) | |
download | mpv-a72b161551062f97dca53a49e44f604124a3532b.tar.bz2 mpv-a72b161551062f97dca53a49e44f604124a3532b.tar.xz |
Changing the behavour of the commandline parameter -af to conform with -vop. Adding new commanline parameter -af-adv for advanced af options. Adding changes to volume control to support commandline parameters.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7994 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libaf/af.c')
-rw-r--r-- | libaf/af.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libaf/af.c b/libaf/af.c index 925af8b1d1..a30e52bfed 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -57,9 +57,12 @@ af_instance_t* af_get(af_stream_t* s, char* name) return NULL; } -// Function for creating a new filter of type name +/*/ Function for creating a new filter of type name. The name may + contain the commandline parameters for the filter */ af_instance_t* af_create(af_stream_t* s, char* name) { + char* cmdline = name; + char* delim = "="; // Allocate space for the new filter and reset all pointers af_instance_t* new=malloc(sizeof(af_instance_t)); if(!new){ @@ -68,11 +71,15 @@ af_instance_t* af_create(af_stream_t* s, char* name) } memset(new,0,sizeof(af_instance_t)); + // Check for commandline parameters + strsep(&cmdline, delim); + // Find filter from name if(NULL == (new->info=af_find(name))) return NULL; - // Make sure that the filter is not already in the list if it is non-reentrant + /* Make sure that the filter is not already in the list if it is + non-reentrant */ if(new->info->flags & AF_FLAGS_NOT_REENTRANT){ if(af_get(s,name)){ mp_msg(MSGT_AFILTER,MSGL_ERR,"There can only be one instance of the filter '%s' in each stream\n",name); @@ -80,14 +87,22 @@ af_instance_t* af_create(af_stream_t* s, char* name) return NULL; } } - + + mp_msg(MSGT_AFILTER,MSGL_V,"Adding filter %s \n",name); + // Initialize the new filter if(AF_OK == new->info->open(new) && - AF_ERROR < new->control(new,AF_CONTROL_POST_CREATE,&s->cfg)) - return new; + AF_ERROR < new->control(new,AF_CONTROL_POST_CREATE,&s->cfg)){ + if(cmdline){ + if(AF_ERROR<new->control(new,AF_CONTROL_COMMAND_LINE,cmdline)) + return new; + } + else + return new; + } free(new); - mp_msg(MSGT_AFILTER,MSGL_ERR,"Couldn't create audio filter '%s'\n",name); + mp_msg(MSGT_AFILTER,MSGL_ERR,"Couldn't create or open audio filter '%s'\n",name); return NULL; } |