Mercurial > mplayer.hg
comparison libaf/af_ladspa.c @ 14390:8f6bd2869325
100l, mp_msg instead af_msg
author | alex |
---|---|
date | Thu, 06 Jan 2005 11:40:34 +0000 |
parents | 3f7f4c9c7901 |
children | f92a93cfc508 |
comparison
equal
deleted
inserted
replaced
14389:7c9df87a2694 | 14390:8f6bd2869325 |
---|---|
72 /* ------------------------------------------------------------------------- */ | 72 /* ------------------------------------------------------------------------- */ |
73 | 73 |
74 /* Local Includes */ | 74 /* Local Includes */ |
75 | 75 |
76 #include "af.h" | 76 #include "af.h" |
77 #include "../mp_msg.h" | |
78 #include "../help_mp.h" | 77 #include "../help_mp.h" |
79 | |
80 /* ------------------------------------------------------------------------- */ | |
81 | |
82 /* Defines */ | |
83 | |
84 /* why, o why, wasn't it defined like this in the first place? */ | |
85 | |
86 #define MSGT_AF MSGT_AFILTER | |
87 | 78 |
88 /* ------------------------------------------------------------------------- */ | 79 /* ------------------------------------------------------------------------- */ |
89 | 80 |
90 /* Filter specific data */ | 81 /* Filter specific data */ |
91 | 82 |
252 } | 243 } |
253 | 244 |
254 } | 245 } |
255 | 246 |
256 if (setup->ninputs == 0) { | 247 if (setup->ninputs == 0) { |
257 mp_msg(MSGT_AF, MSGL_WARN, "%s: %s\n", setup->myname, | 248 af_msg(AF_MSG_WARN, "%s: %s\n", setup->myname, |
258 MSGTR_AF_LADSPA_WarnNoInputs); | 249 MSGTR_AF_LADSPA_WarnNoInputs); |
259 } else if (setup->ninputs == 1) { | 250 } else if (setup->ninputs == 1) { |
260 mp_msg(MSGT_AF, MSGL_V, "%s: this is a mono effect\n", setup->myname); | 251 af_msg(AF_MSG_VERBOSE, "%s: this is a mono effect\n", setup->myname); |
261 } else if (setup->ninputs == 2) { | 252 } else if (setup->ninputs == 2) { |
262 mp_msg(MSGT_AF, MSGL_V, "%s: this is a stereo effect\n", setup->myname); | 253 af_msg(AF_MSG_VERBOSE, "%s: this is a stereo effect\n", setup->myname); |
263 } | 254 } |
264 | 255 |
265 if (setup->ninputs > 2) { | 256 if (setup->ninputs > 2) { |
266 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 257 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
267 MSGTR_AF_LADSPA_ErrMultiChannel); | 258 MSGTR_AF_LADSPA_ErrMultiChannel); |
268 return AF_ERROR; | 259 return AF_ERROR; |
269 } | 260 } |
270 | 261 |
271 if (setup->noutputs == 0) { | 262 if (setup->noutputs == 0) { |
272 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 263 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
273 MSGTR_AF_LADSPA_ErrNoOutputs); | 264 MSGTR_AF_LADSPA_ErrNoOutputs); |
274 return AF_ERROR; | 265 return AF_ERROR; |
275 } | 266 } |
276 | 267 |
277 if (setup->noutputs != setup->ninputs ) { | 268 if (setup->noutputs != setup->ninputs ) { |
278 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 269 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
279 MSGTR_AF_LADSPA_ErrInOutDiff); | 270 MSGTR_AF_LADSPA_ErrInOutDiff); |
280 return AF_ERROR; | 271 return AF_ERROR; |
281 } | 272 } |
282 | 273 |
283 mp_msg(MSGT_AF, MSGL_V, "%s: this plugin has %d input control(s)\n", | 274 af_msg(AF_MSG_VERBOSE, "%s: this plugin has %d input control(s)\n", |
284 setup->myname, setup->ninputcontrols); | 275 setup->myname, setup->ninputcontrols); |
285 | 276 |
286 /* Print list of controls and its range of values it accepts */ | 277 /* Print list of controls and its range of values it accepts */ |
287 | 278 |
288 for (i=0; i<setup->ninputcontrols; i++) { | 279 for (i=0; i<setup->ninputcontrols; i++) { |
289 p = setup->inputcontrolsmap[i]; | 280 p = setup->inputcontrolsmap[i]; |
290 hint = pdes->PortRangeHints[p]; | 281 hint = pdes->PortRangeHints[p]; |
291 mp_msg(MSGT_AF, MSGL_V, " --- %d %s [", i, pdes->PortNames[p]); | 282 af_msg(AF_MSG_VERBOSE, " --- %d %s [", i, pdes->PortNames[p]); |
292 | 283 |
293 if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor)) { | 284 if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor)) { |
294 mp_msg(MSGT_AF, MSGL_V, "%0.2f , ", hint.LowerBound); | 285 af_msg(AF_MSG_VERBOSE, "%0.2f , ", hint.LowerBound); |
295 } else { | 286 } else { |
296 mp_msg(MSGT_AF, MSGL_V, "... , "); | 287 af_msg(AF_MSG_VERBOSE, "... , "); |
297 } | 288 } |
298 | 289 |
299 if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor)) { | 290 if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor)) { |
300 mp_msg(MSGT_AF, MSGL_V, "%0.2f]\n", hint.UpperBound); | 291 af_msg(AF_MSG_VERBOSE, "%0.2f]\n", hint.UpperBound); |
301 } else { | 292 } else { |
302 mp_msg(MSGT_AF, MSGL_V, "...]\n"); | 293 af_msg(AF_MSG_VERBOSE, "...]\n"); |
303 } | 294 } |
304 | 295 |
305 } | 296 } |
306 | 297 |
307 return AF_OK; | 298 return AF_OK; |
344 # ifdef WIN32 /* for windows there's only absolute path support. | 335 # ifdef WIN32 /* for windows there's only absolute path support. |
345 * if you have a windows machine, feel free to fix | 336 * if you have a windows machine, feel free to fix |
346 * this. (path separator, shared objects extension, | 337 * this. (path separator, shared objects extension, |
347 * et cetera). | 338 * et cetera). |
348 */ | 339 */ |
349 mp_msg(MSGT_AF, MSGL_V, "\ton windows, only absolute pathnames " | 340 af_msg(AF_MSG_VERBOSE, "\ton windows, only absolute pathnames " |
350 "are supported\n"); | 341 "are supported\n"); |
351 mp_msg(MSGT_AF, MSGL_V, "\ttrying %s\n", filename); | 342 af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", filename); |
352 return dlopen(filename, flag); | 343 return dlopen(filename, flag); |
353 # endif | 344 # endif |
354 | 345 |
355 filenamelen = strlen(filename); | 346 filenamelen = strlen(filename); |
356 | 347 |
387 needslash = 1; | 378 needslash = 1; |
388 buf[end-start] = '/'; | 379 buf[end-start] = '/'; |
389 } | 380 } |
390 strcpy(buf+needslash+(end-start), filename); | 381 strcpy(buf+needslash+(end-start), filename); |
391 | 382 |
392 mp_msg(MSGT_AF, MSGL_V, "\ttrying %s\n", buf); | 383 af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", buf); |
393 result=dlopen(buf, flag); | 384 result=dlopen(buf, flag); |
394 | 385 |
395 free(buf); | 386 free(buf); |
396 if (result) | 387 if (result) |
397 return result; | 388 return result; |
401 start++; | 392 start++; |
402 } /* end while there's still more in the path */ | 393 } /* end while there's still more in the path */ |
403 } /* end if there's a ladspapath */ | 394 } /* end if there's a ladspapath */ |
404 | 395 |
405 /* last resort, just open it again, so the dlerror() message is correct */ | 396 /* last resort, just open it again, so the dlerror() message is correct */ |
406 mp_msg(MSGT_AF, MSGL_V, "\ttrying %s\n", filename); | 397 af_msg(AF_MSG_VERBOSE, "\ttrying %s\n", filename); |
407 return dlopen(filename,flag); | 398 return dlopen(filename,flag); |
408 } | 399 } |
409 | 400 |
410 /* ------------------------------------------------------------------------- */ | 401 /* ------------------------------------------------------------------------- */ |
411 | 402 |
428 const LADSPA_Descriptor *ladspa_descriptor; | 419 const LADSPA_Descriptor *ladspa_descriptor; |
429 LADSPA_Descriptor_Function descriptor_function; | 420 LADSPA_Descriptor_Function descriptor_function; |
430 int i; | 421 int i; |
431 | 422 |
432 /* load library */ | 423 /* load library */ |
433 mp_msg(MSGT_AF, MSGL_V, "%s: loading ladspa plugin library %s\n", | 424 af_msg(AF_MSG_VERBOSE, "%s: loading ladspa plugin library %s\n", |
434 setup->myname, setup->file); | 425 setup->myname, setup->file); |
435 | 426 |
436 setup->libhandle = mydlopen(setup->file, RTLD_NOW); | 427 setup->libhandle = mydlopen(setup->file, RTLD_NOW); |
437 | 428 |
438 if (!setup->libhandle) { | 429 if (!setup->libhandle) { |
439 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s %s\n\t%s\n", setup->myname, | 430 af_msg(AF_MSG_ERROR, "%s: %s %s\n\t%s\n", setup->myname, |
440 MSGTR_AF_LADSPA_ErrFailedToLoad, setup->file, dlerror() ); | 431 MSGTR_AF_LADSPA_ErrFailedToLoad, setup->file, dlerror() ); |
441 return AF_ERROR; | 432 return AF_ERROR; |
442 } | 433 } |
443 | 434 |
444 mp_msg(MSGT_AF, MSGL_V, "%s: library found.\n", setup->myname); | 435 af_msg(AF_MSG_VERBOSE, "%s: library found.\n", setup->myname); |
445 | 436 |
446 /* find descriptor function */ | 437 /* find descriptor function */ |
447 dlerror(); | 438 dlerror(); |
448 descriptor_function = (LADSPA_Descriptor_Function) dlsym (setup->libhandle, | 439 descriptor_function = (LADSPA_Descriptor_Function) dlsym (setup->libhandle, |
449 "ladspa_descriptor"); | 440 "ladspa_descriptor"); |
450 | 441 |
451 if (!descriptor_function) { | 442 if (!descriptor_function) { |
452 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n\t%s\n", setup->myname, | 443 af_msg(AF_MSG_ERROR, "%s: %s\n\t%s\n", setup->myname, |
453 MSGTR_AF_LADSPA_ErrNoDescriptor, dlerror()); | 444 MSGTR_AF_LADSPA_ErrNoDescriptor, dlerror()); |
454 return AF_ERROR; | 445 return AF_ERROR; |
455 } | 446 } |
456 | 447 |
457 /* if label == help, list all labels in library and exit */ | 448 /* if label == help, list all labels in library and exit */ |
458 | 449 |
459 if (strcmp(setup->label, "help") == 0) { | 450 if (strcmp(setup->label, "help") == 0) { |
460 mp_msg(MSGT_AF, MSGL_INFO, "%s: %s %s:\n", setup->myname, | 451 af_msg(AF_MSG_INFO, "%s: %s %s:\n", setup->myname, |
461 MSGTR_AF_LADSPA_AvailableLabels, setup->file); | 452 MSGTR_AF_LADSPA_AvailableLabels, setup->file); |
462 for (i=0; ; i++) { | 453 for (i=0; ; i++) { |
463 ladspa_descriptor = descriptor_function(i); | 454 ladspa_descriptor = descriptor_function(i); |
464 if (ladspa_descriptor == NULL) { | 455 if (ladspa_descriptor == NULL) { |
465 return AF_ERROR; | 456 return AF_ERROR; |
466 } | 457 } |
467 mp_msg(MSGT_AF, MSGL_INFO, " %-16s - %s (%lu)\n", | 458 af_msg(AF_MSG_INFO, " %-16s - %s (%lu)\n", |
468 ladspa_descriptor->Label, | 459 ladspa_descriptor->Label, |
469 ladspa_descriptor->Name, | 460 ladspa_descriptor->Name, |
470 ladspa_descriptor->UniqueID); | 461 ladspa_descriptor->UniqueID); |
471 } | 462 } |
472 } | 463 } |
473 | 464 |
474 mp_msg(MSGT_AF, MSGL_V, "%s: looking for label\n", setup->myname); | 465 af_msg(AF_MSG_VERBOSE, "%s: looking for label\n", setup->myname); |
475 | 466 |
476 /* find label in library */ | 467 /* find label in library */ |
477 for (i=0; ; i++) { | 468 for (i=0; ; i++) { |
478 ladspa_descriptor = descriptor_function(i); | 469 ladspa_descriptor = descriptor_function(i); |
479 if (ladspa_descriptor == NULL) { | 470 if (ladspa_descriptor == NULL) { |
480 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 471 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
481 MSGTR_AF_LADSPA_ErrLabelNotFound); | 472 MSGTR_AF_LADSPA_ErrLabelNotFound); |
482 return AF_ERROR; | 473 return AF_ERROR; |
483 } | 474 } |
484 if (strcmp(ladspa_descriptor->Label, setup->label) == 0) { | 475 if (strcmp(ladspa_descriptor->Label, setup->label) == 0) { |
485 setup->plugin_descriptor = ladspa_descriptor; | 476 setup->plugin_descriptor = ladspa_descriptor; |
486 mp_msg(MSGT_AF, MSGL_V, "%s: %s found\n", setup->myname, | 477 af_msg(AF_MSG_VERBOSE, "%s: %s found\n", setup->myname, |
487 setup->label); | 478 setup->label); |
488 return AF_OK; | 479 return AF_OK; |
489 } | 480 } |
490 } | 481 } |
491 | 482 |
502 * | 493 * |
503 * \return AF_ERROR | 494 * \return AF_ERROR |
504 */ | 495 */ |
505 | 496 |
506 static int af_ladspa_malloc_failed(char *myname) { | 497 static int af_ladspa_malloc_failed(char *myname) { |
507 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", myname, MSGTR_MemAllocFailed); | 498 af_msg(AF_MSG_ERROR, "%s: %s\n", myname, MSGTR_MemAllocFailed); |
508 return AF_ERROR; | 499 return AF_ERROR; |
509 } | 500 } |
510 | 501 |
511 /* ------------------------------------------------------------------------- */ | 502 /* ------------------------------------------------------------------------- */ |
512 | 503 |
563 /* suboption parser here! | 554 /* suboption parser here! |
564 * format is (ladspa=)file:label:controls.... | 555 * format is (ladspa=)file:label:controls.... |
565 */ | 556 */ |
566 | 557 |
567 if (!arg) { | 558 if (!arg) { |
568 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 559 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
569 MSGTR_AF_LADSPA_ErrNoSuboptions); | 560 MSGTR_AF_LADSPA_ErrNoSuboptions); |
570 return AF_ERROR; | 561 return AF_ERROR; |
571 } | 562 } |
572 | 563 |
573 buf = malloc(strlen(arg)+1); | 564 buf = malloc(strlen(arg)+1); |
575 | 566 |
576 /* file... */ | 567 /* file... */ |
577 buf[0] = '\0'; | 568 buf[0] = '\0'; |
578 sscanf(arg, "%[^:]", buf); | 569 sscanf(arg, "%[^:]", buf); |
579 if (buf[0] == '\0') { | 570 if (buf[0] == '\0') { |
580 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 571 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
581 MSGTR_AF_LADSPA_ErrNoLibFile); | 572 MSGTR_AF_LADSPA_ErrNoLibFile); |
582 free(buf); | 573 free(buf); |
583 return AF_ERROR; | 574 return AF_ERROR; |
584 } | 575 } |
585 arg += strlen(buf); | 576 arg += strlen(buf); |
586 setup->file = strdup(buf); | 577 setup->file = strdup(buf); |
587 if (!setup->file) return af_ladspa_malloc_failed(setup->myname); | 578 if (!setup->file) return af_ladspa_malloc_failed(setup->myname); |
588 mp_msg(MSGT_AF, MSGL_V, "%s: file --> %s\n", setup->myname, | 579 af_msg(AF_MSG_VERBOSE, "%s: file --> %s\n", setup->myname, |
589 setup->file); | 580 setup->file); |
590 if (*(char*)arg != '\0') arg++; /* read ':' */ | 581 if (*(char*)arg != '\0') arg++; /* read ':' */ |
591 | 582 |
592 /* label... */ | 583 /* label... */ |
593 buf[0] = '\0'; | 584 buf[0] = '\0'; |
594 sscanf(arg, "%[^:]", buf); | 585 sscanf(arg, "%[^:]", buf); |
595 if (buf[0] == '\0') { | 586 if (buf[0] == '\0') { |
596 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 587 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
597 MSGTR_AF_LADSPA_ErrNoLabel); | 588 MSGTR_AF_LADSPA_ErrNoLabel); |
598 free(buf); | 589 free(buf); |
599 return AF_ERROR; | 590 return AF_ERROR; |
600 } | 591 } |
601 arg += strlen(buf); | 592 arg += strlen(buf); |
602 setup->label = strdup(buf); | 593 setup->label = strdup(buf); |
603 if (!setup->label) return af_ladspa_malloc_failed(setup->myname); | 594 if (!setup->label) return af_ladspa_malloc_failed(setup->myname); |
604 mp_msg(MSGT_AF, MSGL_V, "%s: label --> %s\n", setup->myname, | 595 af_msg(AF_MSG_VERBOSE, "%s: label --> %s\n", setup->myname, |
605 setup->label); | 596 setup->label); |
606 /* if (*(char*)arg != '0') arg++; */ /* read ':' */ | 597 /* if (*(char*)arg != '0') arg++; */ /* read ':' */ |
607 | 598 |
608 free(buf); /* no longer needed */ | 599 free(buf); /* no longer needed */ |
609 | 600 |
627 | 618 |
628 /* ninputcontrols is set by now, read control values from arg */ | 619 /* ninputcontrols is set by now, read control values from arg */ |
629 | 620 |
630 for(i=0; i<setup->ninputcontrols; i++) { | 621 for(i=0; i<setup->ninputcontrols; i++) { |
631 if (!arg || (*(char*)arg != ':') ) { | 622 if (!arg || (*(char*)arg != ':') ) { |
632 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 623 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
633 MSGTR_AF_LADSPA_ErrNotEnoughControls); | 624 MSGTR_AF_LADSPA_ErrNotEnoughControls); |
634 return AF_ERROR; | 625 return AF_ERROR; |
635 } | 626 } |
636 arg++; | 627 arg++; |
637 r = sscanf(arg, "%f", &val); | 628 r = sscanf(arg, "%f", &val); |
638 if (r!=1) { | 629 if (r!=1) { |
639 mp_msg(MSGT_AF, MSGL_ERR, "%s: %s\n", setup->myname, | 630 af_msg(AF_MSG_ERROR, "%s: %s\n", setup->myname, |
640 MSGTR_AF_LADSPA_ErrNotEnoughControls); | 631 MSGTR_AF_LADSPA_ErrNotEnoughControls); |
641 return AF_ERROR; | 632 return AF_ERROR; |
642 } | 633 } |
643 setup->inputcontrols[setup->inputcontrolsmap[i]] = val; | 634 setup->inputcontrols[setup->inputcontrolsmap[i]] = val; |
644 arg = strchr(arg, ':'); | 635 arg = strchr(arg, ':'); |
645 } | 636 } |
646 | 637 |
647 mp_msg(MSGT_AF, MSGL_V, "%s: input controls: ", setup->myname); | 638 af_msg(AF_MSG_VERBOSE, "%s: input controls: ", setup->myname); |
648 for(i=0; i<setup->ninputcontrols; i++) { | 639 for(i=0; i<setup->ninputcontrols; i++) { |
649 mp_msg(MSGT_AF, MSGL_V, "%0.4f ", | 640 af_msg(AF_MSG_VERBOSE, "%0.4f ", |
650 setup->inputcontrols[setup->inputcontrolsmap[i]]); | 641 setup->inputcontrols[setup->inputcontrolsmap[i]]); |
651 } | 642 } |
652 mp_msg(MSGT_AF, MSGL_V, "\n"); | 643 af_msg(AF_MSG_VERBOSE, "\n"); |
653 | 644 |
654 /* check boundaries of inputcontrols */ | 645 /* check boundaries of inputcontrols */ |
655 | 646 |
656 mp_msg(MSGT_AF, MSGL_V, "%s: checking boundaries of input controls\n", | 647 af_msg(AF_MSG_VERBOSE, "%s: checking boundaries of input controls\n", |
657 setup->myname); | 648 setup->myname); |
658 for(i=0; i<setup->ninputcontrols; i++) { | 649 for(i=0; i<setup->ninputcontrols; i++) { |
659 int p = setup->inputcontrolsmap[i]; | 650 int p = setup->inputcontrolsmap[i]; |
660 LADSPA_PortRangeHint hint = | 651 LADSPA_PortRangeHint hint = |
661 setup->plugin_descriptor->PortRangeHints[p]; | 652 setup->plugin_descriptor->PortRangeHints[p]; |
662 val = setup->inputcontrols[p]; | 653 val = setup->inputcontrols[p]; |
663 | 654 |
664 if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor) && | 655 if (LADSPA_IS_HINT_BOUNDED_BELOW(hint.HintDescriptor) && |
665 val < hint.LowerBound) { | 656 val < hint.LowerBound) { |
666 mp_msg(MSGT_AF, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlBelow, | 657 af_msg(AF_MSG_ERROR, MSGTR_AF_LADSPA_ErrControlBelow, |
667 setup->myname, i, hint.LowerBound); | 658 setup->myname, i, hint.LowerBound); |
668 return AF_ERROR; | 659 return AF_ERROR; |
669 } | 660 } |
670 if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor) && | 661 if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint.HintDescriptor) && |
671 val > hint.UpperBound) { | 662 val > hint.UpperBound) { |
672 mp_msg(MSGT_AF, MSGL_ERR, MSGTR_AF_LADSPA_ErrControlAbove, | 663 af_msg(AF_MSG_ERROR, MSGTR_AF_LADSPA_ErrControlAbove, |
673 setup->myname, i, hint.UpperBound); | 664 setup->myname, i, hint.UpperBound); |
674 return AF_ERROR; | 665 return AF_ERROR; |
675 } | 666 } |
676 } | 667 } |
677 mp_msg(MSGT_AF, MSGL_V, "%s: all controls have sane values\n", | 668 af_msg(AF_MSG_VERBOSE, "%s: all controls have sane values\n", |
678 setup->myname); | 669 setup->myname); |
679 | 670 |
680 /* All is well! */ | 671 /* All is well! */ |
681 setup->status = AF_OK; | 672 setup->status = AF_OK; |
682 | 673 |
704 if (af->setup) { | 695 if (af->setup) { |
705 af_ladspa_t *setup = (af_ladspa_t*) af->setup; | 696 af_ladspa_t *setup = (af_ladspa_t*) af->setup; |
706 const LADSPA_Descriptor *pdes = setup->plugin_descriptor; | 697 const LADSPA_Descriptor *pdes = setup->plugin_descriptor; |
707 | 698 |
708 if (setup->myname) { | 699 if (setup->myname) { |
709 mp_msg(MSGT_AF, MSGL_V, "%s: cleaning up\n", setup->myname); | 700 af_msg(AF_MSG_VERBOSE, "%s: cleaning up\n", setup->myname); |
710 free(setup->myname); | 701 free(setup->myname); |
711 } | 702 } |
712 | 703 |
713 if (setup->chhandles) { | 704 if (setup->chhandles) { |
714 for(i=0; i<setup->nch; i++) { | 705 for(i=0; i<setup->nch; i++) { |
799 /* if setup->nch==0, it's the first call, if not, something has | 790 /* if setup->nch==0, it's the first call, if not, something has |
800 * changed and all previous mallocs have to be freed | 791 * changed and all previous mallocs have to be freed |
801 */ | 792 */ |
802 | 793 |
803 if (setup->nch != 0) { | 794 if (setup->nch != 0) { |
804 mp_msg(MSGT_AF, MSGL_DBG2, "%s: bufsize change; free old buffer\n", | 795 af_msg(AF_MSG_DEBUG1, "%s: bufsize change; free old buffer\n", |
805 setup->myname); | 796 setup->myname); |
806 | 797 |
807 if(setup->inbufs) { | 798 if(setup->inbufs) { |
808 for(i=0; i<setup->nch; i++) { | 799 for(i=0; i<setup->nch; i++) { |
809 if(setup->inbufs[i]) | 800 if(setup->inbufs[i]) |
824 setup->nch = nch; | 815 setup->nch = nch; |
825 | 816 |
826 setup->inbufs = calloc(nch, sizeof(float*)); | 817 setup->inbufs = calloc(nch, sizeof(float*)); |
827 setup->outbufs = calloc(nch, sizeof(float*)); | 818 setup->outbufs = calloc(nch, sizeof(float*)); |
828 | 819 |
829 mp_msg(MSGT_AF, MSGL_DBG2, "%s: bufsize = %d\n", | 820 af_msg(AF_MSG_DEBUG1, "%s: bufsize = %d\n", |
830 setup->myname, setup->bufsize); | 821 setup->myname, setup->bufsize); |
831 | 822 |
832 for(i=0; i<nch; i++) { | 823 for(i=0; i<nch; i++) { |
833 setup->inbufs[i] = calloc(setup->bufsize, sizeof(float)); | 824 setup->inbufs[i] = calloc(setup->bufsize, sizeof(float)); |
834 setup->outbufs[i] = calloc(setup->bufsize, sizeof(float)); | 825 setup->outbufs[i] = calloc(setup->bufsize, sizeof(float)); |
987 | 978 |
988 return AF_OK; | 979 return AF_OK; |
989 } | 980 } |
990 | 981 |
991 /* ------------------------------------------------------------------------- */ | 982 /* ------------------------------------------------------------------------- */ |
992 | |
993 #undef MSGT_AF | |
994 |