Mercurial > hg > xmms-sid
comparison src/xmms-sid.c @ 403:b2d233cd01ba
Add more debugging output.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 01 Jun 2006 22:39:02 +0000 |
parents | f997b79a7251 |
children | 7f694e5a1493 |
comparison
equal
deleted
inserted
replaced
402:f997b79a7251 | 403:b2d233cd01ba |
---|---|
405 goto xs_err_exit; | 405 goto xs_err_exit; |
406 } | 406 } |
407 | 407 |
408 | 408 |
409 /* Open the audio output */ | 409 /* Open the audio output */ |
410 XSDEBUG("open audio output (%d, %d, %d)\n", | |
411 myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels); | |
412 | |
410 if (!xs_plugin_ip.output-> | 413 if (!xs_plugin_ip.output-> |
411 open_audio(myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels)) { | 414 open_audio(myStatus.audioFormat, myStatus.audioFrequency, myStatus.audioChannels)) { |
412 xs_error("Couldn't open XMMS audio output (fmt=%x, freq=%i, nchan=%i)!\n", myStatus.audioFormat, | 415 xs_error("Couldn't open XMMS audio output (fmt=%x, freq=%i, nchan=%i)!\n", myStatus.audioFormat, |
413 myStatus.audioFrequency, myStatus.audioChannels); | 416 myStatus.audioFrequency, myStatus.audioChannels); |
414 | 417 |
419 } | 422 } |
420 | 423 |
421 audioOpen = TRUE; | 424 audioOpen = TRUE; |
422 | 425 |
423 /* Set song information for current subtune */ | 426 /* Set song information for current subtune */ |
427 XSDEBUG("set tune info\n"); | |
424 xs_plugin_ip.set_info(myTune->subTunes[myStatus.currSong-1].tuneTitle, | 428 xs_plugin_ip.set_info(myTune->subTunes[myStatus.currSong-1].tuneTitle, |
425 (songLength > 0) ? (songLength * 1000) : 0, | 429 (songLength > 0) ? (songLength * 1000) : 0, |
426 (myTune->subTunes[myStatus.currSong-1].tuneSpeed > 0) ? | 430 (myTune->subTunes[myStatus.currSong-1].tuneSpeed > 0) ? |
427 (myTune->subTunes[myStatus.currSong-1].tuneSpeed * 1000) : -1, | 431 (myTune->subTunes[myStatus.currSong-1].tuneSpeed * 1000) : -1, |
428 myStatus.audioFrequency, myStatus.audioChannels); | 432 myStatus.audioFrequency, myStatus.audioChannels); |
493 /* Close audio output plugin */ | 497 /* Close audio output plugin */ |
494 if (audioOpen) { | 498 if (audioOpen) { |
495 XSDEBUG("close audio #1\n"); | 499 XSDEBUG("close audio #1\n"); |
496 xs_plugin_ip.output->close_audio(); | 500 xs_plugin_ip.output->close_audio(); |
497 audioOpen = FALSE; | 501 audioOpen = FALSE; |
502 XSDEBUG("closed\n"); | |
498 } | 503 } |
499 | 504 |
500 /* Now determine if we continue by selecting other subtune or something */ | 505 /* Now determine if we continue by selecting other subtune or something */ |
501 if (!myStatus.isPlaying && !xs_cfg.subAutoEnable) | 506 if (!myStatus.isPlaying && !xs_cfg.subAutoEnable) |
502 doPlay = FALSE; | 507 doPlay = FALSE; |
503 } | 508 } |
504 | 509 |
505 xs_err_exit: | 510 xs_err_exit: |
511 XSDEBUG("out of playing loop\n"); | |
512 | |
506 /* Close audio output plugin */ | 513 /* Close audio output plugin */ |
507 if (audioOpen) { | 514 if (audioOpen) { |
508 XSDEBUG("close audio #2\n"); | 515 XSDEBUG("close audio #2\n"); |
509 xs_plugin_ip.output->close_audio(); | 516 xs_plugin_ip.output->close_audio(); |
517 XSDEBUG("closed\n"); | |
510 } | 518 } |
511 | 519 |
512 g_free(audioBuffer); | 520 g_free(audioBuffer); |
513 g_free(oversampleBuffer); | 521 g_free(oversampleBuffer); |
514 | 522 |
583 * | 591 * |
584 * Finally tune and other memory allocations are free'd. | 592 * Finally tune and other memory allocations are free'd. |
585 */ | 593 */ |
586 void xs_stop(void) | 594 void xs_stop(void) |
587 { | 595 { |
588 XSDEBUG("STOP_REQ\n"); | 596 XSDEBUG("stop requested\n"); |
589 | 597 |
590 /* Close the sub-tune control window, if any */ | 598 /* Close the sub-tune control window, if any */ |
591 xs_subctrl_close(); | 599 xs_subctrl_close(); |
592 | 600 |
593 /* Lock xs_status and stop playing thread */ | 601 /* Lock xs_status and stop playing thread */ |
594 XS_MUTEX_LOCK(xs_status); | 602 XS_MUTEX_LOCK(xs_status); |
595 if (xs_status.isPlaying) { | 603 if (xs_status.isPlaying) { |
596 /* Stop playing */ | |
597 XSDEBUG("stopping...\n"); | 604 XSDEBUG("stopping...\n"); |
598 xs_status.isPlaying = FALSE; | 605 xs_status.isPlaying = FALSE; |
599 XS_MUTEX_UNLOCK(xs_status); | 606 XS_MUTEX_UNLOCK(xs_status); |
600 pthread_join(xs_decode_thread, NULL); | 607 pthread_join(xs_decode_thread, NULL); |
601 } else { | 608 } else { |
602 XS_MUTEX_UNLOCK(xs_status); | 609 XS_MUTEX_UNLOCK(xs_status); |
603 } | 610 } |
604 | 611 |
612 XSDEBUG("done, updating status\n"); | |
613 | |
605 /* Status is now stopped, update the sub-tune | 614 /* Status is now stopped, update the sub-tune |
606 * controller in fileinfo window (if open) | 615 * controller in fileinfo window (if open) |
607 */ | 616 */ |
608 xs_fileinfo_update(); | 617 xs_fileinfo_update(); |
609 | 618 |
610 /* Free tune information */ | 619 /* Free tune information */ |
620 XS_MUTEX_LOCK(xs_status); | |
611 xs_status.sidPlayer->plrDeleteSID(&xs_status); | 621 xs_status.sidPlayer->plrDeleteSID(&xs_status); |
612 xs_tuneinfo_free(xs_status.tuneInfo); | 622 xs_tuneinfo_free(xs_status.tuneInfo); |
613 xs_status.tuneInfo = NULL; | 623 xs_status.tuneInfo = NULL; |
624 XS_MUTEX_UNLOCK(xs_status); | |
625 XSDEBUG("ok\n"); | |
614 } | 626 } |
615 | 627 |
616 | 628 |
617 /* | 629 /* |
618 * Pause/unpause the playing | 630 * Pause/unpause the playing |