Mercurial > mplayer.hg
comparison libaf/af.c @ 14818:663c1ea5f595
finally remove the refences to bps outside libaf. also simplification of some messages and removed redundants
author | alex |
---|---|
date | Fri, 25 Feb 2005 11:11:07 +0000 |
parents | 108423cf7b3f |
children | 7eab9c86ae19 |
comparison
equal
deleted
inserted
replaced
14817:878745349274 | 14818:663c1ea5f595 |
---|---|
263 memcpy(&in,new->prev->data,sizeof(af_data_t)); | 263 memcpy(&in,new->prev->data,sizeof(af_data_t)); |
264 if(AF_OK != (rv = new->control(new,AF_CONTROL_REINIT,&in))) | 264 if(AF_OK != (rv = new->control(new,AF_CONTROL_REINIT,&in))) |
265 return rv; | 265 return rv; |
266 } | 266 } |
267 // Insert format filter | 267 // Insert format filter |
268 if(((af->prev?af->prev->data->format:s->input.format) != in.format) || | 268 if((af->prev?af->prev->data->format:s->input.format) != in.format){ |
269 ((af->prev?af->prev->data->bps:s->input.bps) != in.bps)){ | |
270 // Create format filter | 269 // Create format filter |
271 if(NULL == (new = af_prepend(s,af,"format"))) | 270 if(NULL == (new = af_prepend(s,af,"format"))) |
272 return AF_ERROR; | 271 return AF_ERROR; |
273 // Set output bits per sample | 272 // Set output bits per sample |
274 in.format |= af_bits2fmt(in.bps*8); | 273 in.format |= af_bits2fmt(in.bps*8); |
436 if(AF_OK != af_reinit(s,af)) | 435 if(AF_OK != af_reinit(s,af)) |
437 return -1; | 436 return -1; |
438 } | 437 } |
439 | 438 |
440 // Check output format fix if not OK | 439 // Check output format fix if not OK |
441 if((s->last->data->format != s->output.format) || | 440 if(s->last->data->format != s->output.format){ |
442 (s->last->data->bps != s->output.bps)){ | |
443 if(strcmp(s->last->info->name,"format")) | 441 if(strcmp(s->last->info->name,"format")) |
444 af = af_append(s,s->last,"format"); | 442 af = af_append(s,s->last,"format"); |
445 else | 443 else |
446 af = s->last; | 444 af = s->last; |
447 // Init the new filter | 445 // Init the new filter |
455 // Re init again just in case | 453 // Re init again just in case |
456 if(AF_OK != af_reinit(s,s->first)) | 454 if(AF_OK != af_reinit(s,s->first)) |
457 return -1; | 455 return -1; |
458 | 456 |
459 if((s->last->data->format != s->output.format) || | 457 if((s->last->data->format != s->output.format) || |
460 (s->last->data->bps != s->output.bps) || | |
461 (s->last->data->nch != s->output.nch) || | 458 (s->last->data->nch != s->output.nch) || |
462 (s->last->data->rate != s->output.rate)) { | 459 (s->last->data->rate != s->output.rate)) { |
463 // Something is stuffed audio out will not work | 460 // Something is stuffed audio out will not work |
464 af_msg(AF_MSG_ERROR,"[libaf] Unable to setup filter system can not" | 461 af_msg(AF_MSG_ERROR,"[libaf] Unable to setup filter system can not" |
465 " meet sound-card demands, please send bugreport. \n"); | 462 " meet sound-card demands, please send bugreport. \n"); |
696 af_msg(AF_MSG_INFO, " %-15s: %s\n", filter_list[i]->name, filter_list[i]->info); | 693 af_msg(AF_MSG_INFO, " %-15s: %s\n", filter_list[i]->name, filter_list[i]->info); |
697 i++; | 694 i++; |
698 } | 695 } |
699 } | 696 } |
700 | 697 |
698 void af_fix_parameters(af_data_t *data) | |
699 { | |
700 data->bps = af_fmt2bits(data->format)/8; | |
701 } |