comparison libaf/af_format.c @ 14717:51a7560a92b7

confusing mixture of typecasts and casted variable, removed typecasts
author reimar
date Thu, 17 Feb 2005 15:35:44 +0000
parents 95bb94a930a3
children 85dc314b3d80
comparison
equal deleted inserted replaced
14716:7b2abc34b737 14717:51a7560a92b7
285 char buf1[256]; 285 char buf1[256];
286 char buf2[256]; 286 char buf2[256];
287 af_data_t *data = arg; 287 af_data_t *data = arg;
288 288
289 // Make sure this filter isn't redundant 289 // Make sure this filter isn't redundant
290 if(af->data->format == ((af_data_t*)arg)->format && 290 if(af->data->format == data->format &&
291 af->data->bps == ((af_data_t*)arg)->bps) 291 af->data->bps == data->bps)
292 return AF_DETACH; 292 return AF_DETACH;
293 293
294 // Check for errors in configuraton 294 // Check for errors in configuraton
295 if((AF_OK != check_bps(((af_data_t*)arg)->bps)) || 295 if((AF_OK != check_bps(data->bps)) ||
296 (AF_OK != check_format(((af_data_t*)arg)->format)) || 296 (AF_OK != check_format(data->format)) ||
297 (AF_OK != check_bps(af->data->bps)) || 297 (AF_OK != check_bps(af->data->bps)) ||
298 (AF_OK != check_format(af->data->format))) 298 (AF_OK != check_format(af->data->format)))
299 return AF_ERROR; 299 return AF_ERROR;
300 300
301 af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %s to %s\n", 301 af_msg(AF_MSG_VERBOSE,"[format] Changing sample format from %s to %s\n",
302 af_fmt2str(((af_data_t*)arg)->format,buf1,256), 302 af_fmt2str(data->format,buf1,256),
303 af_fmt2str(af->data->format,buf2,256)); 303 af_fmt2str(af->data->format,buf2,256));
304 304
305 af->data->rate = ((af_data_t*)arg)->rate; 305 af->data->rate = data->rate;
306 af->data->nch = ((af_data_t*)arg)->nch; 306 af->data->nch = data->nch;
307 af->mul.n = af->data->bps; 307 af->mul.n = af->data->bps;
308 af->mul.d = ((af_data_t*)arg)->bps; 308 af->mul.d = data->bps;
309 af_frac_cancel(&af->mul); 309 af_frac_cancel(&af->mul);
310 310
311 af->play = play; // set default 311 af->play = play; // set default
312 312
313 // look whether only endianess differences are there 313 // look whether only endianess differences are there
319 } 319 }
320 if ((data->format == AF_FORMAT_FLOAT_NE) && 320 if ((data->format == AF_FORMAT_FLOAT_NE) &&
321 (af->data->format == AF_FORMAT_S16_NE)) 321 (af->data->format == AF_FORMAT_S16_NE))
322 { 322 {
323 af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n", 323 af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n",
324 af_fmt2str(((af_data_t*)arg)->format,buf1,256), 324 af_fmt2str(data->format,buf1,256),
325 af_fmt2str(af->data->format,buf2,256)); 325 af_fmt2str(af->data->format,buf2,256));
326 af->play = play_float_s16; 326 af->play = play_float_s16;
327 } 327 }
328 if ((data->format == AF_FORMAT_S16_NE) && 328 if ((data->format == AF_FORMAT_S16_NE) &&
329 (af->data->format == AF_FORMAT_FLOAT_NE)) 329 (af->data->format == AF_FORMAT_FLOAT_NE))
330 { 330 {
331 af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n", 331 af_msg(AF_MSG_VERBOSE,"[format] Accelerated %s to %s conversion\n",
332 af_fmt2str(((af_data_t*)arg)->format,buf1,256), 332 af_fmt2str(data->format,buf1,256),
333 af_fmt2str(af->data->format,buf2,256)); 333 af_fmt2str(af->data->format,buf2,256));
334 af->play = play_s16_float; 334 af->play = play_s16_float;
335 } 335 }
336 return AF_OK; 336 return AF_OK;
337 } 337 }