# HG changeset patch # User mmu_man # Date 1048777696 0 # Node ID 265d01c2248f2a5bbb6a4ea10e9f08bdf10c9b23 # Parent 2d3083edb99f907aeac51c133782e48c56ae3edb the media node now won't connect itself to the default audio input with -ad wait: (allows redirecting another node to it) diff -r 2d3083edb99f -r 265d01c2248f beosaudio.cpp --- a/beosaudio.cpp Thu Mar 27 14:44:30 2003 +0000 +++ b/beosaudio.cpp Thu Mar 27 15:08:16 2003 +0000 @@ -181,7 +181,7 @@ } #endif -static int audio_open(AudioData *s, int is_output) +static int audio_open(AudioData *s, int is_output, const char *audio_device) { int p[2]; int ret; @@ -210,7 +210,13 @@ set_thread_priority(find_thread(NULL), B_DISPLAY_PRIORITY+1); #ifdef HAVE_BSOUNDRECORDER if (!is_output) { - s->recorder = new BSoundRecorder(&iformat, false, "ffmpeg input", audiorecord_callback); + bool wait_for_input = false; + if (audio_device && !strcmp(audio_device, "wait:")) + wait_for_input = true; + s->recorder = new BSoundRecorder(&iformat, wait_for_input, "ffmpeg input", audiorecord_callback); + if (wait_for_input && (s->recorder->InitCheck() == B_OK)) { + s->recorder->WaitForIncomingConnection(&iformat); + } if (s->recorder->InitCheck() != B_OK || iformat.format != media_raw_audio_format::B_AUDIO_SHORT) { delete s->recorder; s->recorder = NULL; @@ -283,7 +289,7 @@ st = s1->streams[0]; s->sample_rate = st->codec.sample_rate; s->channels = st->codec.channels; - ret = audio_open(s, 1); + ret = audio_open(s, 1, NULL); if (ret < 0) return -EIO; return 0; @@ -345,7 +351,7 @@ s->sample_rate = ap->sample_rate; s->channels = ap->channels; - ret = audio_open(s, 0); + ret = audio_open(s, 0, ap->device); if (ret < 0) { av_free(st); return -EIO;