af.c: Minor simplification of af_init

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32347 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-09-25 11:55:56 +00:00 committed by Uoti Urpala
parent 8d466ff705
commit 7dd0d8f6df
1 changed files with 6 additions and 5 deletions

View File

@ -437,11 +437,7 @@ int af_init(af_stream_t* s)
// Check if this is the first call // Check if this is the first call
if(!s->first){ if(!s->first){
// Add all filters in the list (if there are any) // Add all filters in the list (if there are any)
if(!s->cfg.list){ // To make automatic format conversion work if (s->cfg.list) {
if(!af_append(s,s->first,"dummy"))
return -1;
}
else{
while(s->cfg.list[i]){ while(s->cfg.list[i]){
if(!af_append(s,s->last,s->cfg.list[i++])) if(!af_append(s,s->last,s->cfg.list[i++]))
return -1; return -1;
@ -449,6 +445,11 @@ int af_init(af_stream_t* s)
} }
} }
// If we do not have any filters otherwise
// add dummy to make automatic format conversion work
if (!s->first && !af_append(s, s->first, "dummy"))
return -1;
// Init filters // Init filters
if(AF_OK != af_reinit(s,s->first)) if(AF_OK != af_reinit(s,s->first))
return -1; return -1;