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:
beveloper
2003-06-03 19:00:34 +00:00
parent 69983609f2
commit a8c2408c09
2 changed files with 11 additions and 16 deletions
+1 -7
View File
@@ -297,13 +297,7 @@ _SoundPlayNode::PrepareToConnect(const media_source& what, const media_destinati
fprintf(stderr, "\tnon-raw-audio format?!\n"); fprintf(stderr, "\tnon-raw-audio format?!\n");
return B_MEDIA_BAD_FORMAT; return B_MEDIA_BAD_FORMAT;
} }
else if (format->u.raw_audio.format != media_raw_audio_format::B_AUDIO_SHORT) // !!! validate all other fields except for buffer_size here, because the consumer might have
{
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()? // supplied different values from AcceptFormat()?
// check the buffer size, which may still be wildcarded // check the buffer size, which may still be wildcarded
+10 -9
View File
@@ -486,7 +486,7 @@ BSoundPlayer::Init(
void (*Notifier)(void *, sound_player_notification what, ...), void (*Notifier)(void *, sound_player_notification what, ...),
void * cookie) void * cookie)
{ {
BROKEN(); CALLED();
_m_node = NULL; _m_node = NULL;
_m_sounds = NULL; _m_sounds = NULL;
_m_waiting = NULL; _m_waiting = NULL;
@@ -546,9 +546,9 @@ BSoundPlayer::Init(
fmt.buffer_size = 4096; fmt.buffer_size = 4096;
if (fmt.channel_count != 1 && fmt.channel_count != 2) 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) 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_bufsize = fmt.buffer_size;
_m_buf = new char[_m_bufsize]; _m_buf = new char[_m_bufsize];
@@ -590,6 +590,13 @@ BSoundPlayer::Init(
goto the_end; 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.type = B_MEDIA_RAW_AUDIO;
//tryformat.fileAudioOutput.format; //tryformat.fileAudioOutput.format;
tryFormat = _output.format; tryFormat = _output.format;
@@ -599,12 +606,6 @@ BSoundPlayer::Init(
goto the_end; 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); printf("BSoundPlayer node %ld has timesource %ld\n", _m_node->Node().node, _m_node->TimeSource()->Node().node);