fixed format setup, CL-Amp works now
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3410 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -297,12 +297,6 @@ _SoundPlayNode::PrepareToConnect(const media_source& what, const media_destinati
|
||||
fprintf(stderr, "\tnon-raw-audio format?!\n");
|
||||
return B_MEDIA_BAD_FORMAT;
|
||||
}
|
||||
else if (format->u.raw_audio.format != media_raw_audio_format::B_AUDIO_SHORT)
|
||||
{
|
||||
fprintf(stderr, "\tnon-short-audio format?!\n");
|
||||
return B_MEDIA_BAD_FORMAT;
|
||||
}
|
||||
|
||||
// !!! validate all other fields except for buffer_size here, because the consumer might have
|
||||
// supplied different values from AcceptFormat()?
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ BSoundPlayer::Init(
|
||||
void (*Notifier)(void *, sound_player_notification what, ...),
|
||||
void * cookie)
|
||||
{
|
||||
BROKEN();
|
||||
CALLED();
|
||||
_m_node = NULL;
|
||||
_m_sounds = NULL;
|
||||
_m_waiting = NULL;
|
||||
@@ -546,9 +546,9 @@ BSoundPlayer::Init(
|
||||
fmt.buffer_size = 4096;
|
||||
|
||||
if (fmt.channel_count != 1 && fmt.channel_count != 2)
|
||||
debugger("BSoundPlayer: not a 1 or 2 channel audio format\n");
|
||||
FATAL("BSoundPlayer: not a 1 or 2 channel audio format\n");
|
||||
if (fmt.frame_rate <= 0.0f)
|
||||
debugger("BSoundPlayer: framerate must be > 0\n");
|
||||
FATAL("BSoundPlayer: framerate must be > 0\n");
|
||||
|
||||
_m_bufsize = fmt.buffer_size;
|
||||
_m_buf = new char[_m_bufsize];
|
||||
@@ -590,6 +590,13 @@ BSoundPlayer::Init(
|
||||
goto the_end;
|
||||
}
|
||||
|
||||
// Set an appropriate run mode for the producer
|
||||
err = roster->SetRunModeNode(_m_node->Node(), BMediaNode::B_INCREASE_LATENCY);
|
||||
if(err != B_OK) {
|
||||
TRACE("BSoundPlayer::Init: Couldn't SetRunModeNode\n");
|
||||
goto the_end;
|
||||
}
|
||||
|
||||
//tryFormat.type = B_MEDIA_RAW_AUDIO;
|
||||
//tryformat.fileAudioOutput.format;
|
||||
tryFormat = _output.format;
|
||||
@@ -599,12 +606,6 @@ BSoundPlayer::Init(
|
||||
goto the_end;
|
||||
}
|
||||
|
||||
// Set an appropriate run mode for the producer
|
||||
err = roster->SetRunModeNode(_m_node->Node(), BMediaNode::B_INCREASE_LATENCY);
|
||||
if(err != B_OK) {
|
||||
TRACE("BSoundPlayer::Init: Couldn't SetRunModeNode\n");
|
||||
goto the_end;
|
||||
}
|
||||
|
||||
printf("BSoundPlayer node %ld has timesource %ld\n", _m_node->Node().node, _m_node->TimeSource()->Node().node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user