|
a/sc2src/alsadirect.cpp |
|
b/sc2src/alsadirect.cpp |
|
... |
|
... |
791 |
free(src_data.data_out);
|
791 |
free(src_data.data_out);
|
792 |
LOGDEB("audioEater returning");
|
792 |
LOGDEB("audioEater returning");
|
793 |
return (void *)1;
|
793 |
return (void *)1;
|
794 |
}
|
794 |
}
|
795 |
|
795 |
|
|
|
796 |
// Map the ALSA state to the audio eater state.
|
|
|
797 |
static AudioEater::AudioState audioState()
|
|
|
798 |
{
|
|
|
799 |
snd_pcm_state_t pcm_state;
|
|
|
800 |
AudioEater::AudioState state = AudioEater::AudioState::UNKNOWN;
|
|
|
801 |
|
|
|
802 |
if (pcm != nullptr) {
|
|
|
803 |
pcm_state = snd_pcm_state(pcm);
|
|
|
804 |
LOGDEB("alsaEater: PCM state " << pcm_state << endl);
|
|
|
805 |
switch (pcm_state) {
|
|
|
806 |
case SND_PCM_STATE_RUNNING:
|
|
|
807 |
state = AudioEater::AudioState::PLAYING;
|
|
|
808 |
break;
|
|
|
809 |
default:
|
|
|
810 |
state = AudioEater::AudioState::STOPPED;
|
|
|
811 |
break;
|
|
|
812 |
}
|
|
|
813 |
}
|
|
|
814 |
|
|
|
815 |
return state;
|
|
|
816 |
}
|
|
|
817 |
|
796 |
AudioEater alsaAudioEater(AudioEater::BO_HOST, &audioEater);
|
818 |
AudioEater alsaAudioEater(AudioEater::BO_HOST, &audioEater, &audioState);
|