changed debug output
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4917 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a6d316d89d
commit
2feec67c73
@ -84,7 +84,8 @@ status_t SendToServer(BMessage *msg)
|
||||
status_t rv;
|
||||
rv = MediaServerMessenger->SendMessage(msg, static_cast<BHandler *>(NULL), TIMEOUT);
|
||||
if (rv != B_OK) {
|
||||
ERROR("SendToServer: SendMessage failed\n");
|
||||
ERROR("SendToServer: SendMessage failed, error 0x%08lx (%s)\n", rv, strerror(rv));
|
||||
DEBUG_ONLY(msg->PrintToStream());
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@ -120,7 +121,7 @@ status_t SendToPort(port_id sendport, int32 msgcode, command_data *msg, int size
|
||||
status_t rv;
|
||||
rv = write_port_etc(sendport, msgcode, msg, size, B_RELATIVE_TIMEOUT, TIMEOUT);
|
||||
if (rv != B_OK) {
|
||||
ERROR("SendToPort: write_port failed, port %ld, error %#lx (%s)\n", sendport, rv, strerror(rv));
|
||||
ERROR("SendToPort: write_port failed, msgcode 0x%lx, port %ld, error %#lx (%s)\n", msgcode, sendport, rv, strerror(rv));
|
||||
if (rv == B_BAD_PORT_ID && sendport == MediaServerPort) {
|
||||
find_media_server_port();
|
||||
sendport = MediaServerPort;
|
||||
@ -132,7 +133,7 @@ status_t SendToPort(port_id sendport, int32 msgcode, command_data *msg, int size
|
||||
}
|
||||
rv = write_port_etc(sendport, msgcode, msg, size, B_RELATIVE_TIMEOUT, TIMEOUT);
|
||||
if (rv != B_OK) {
|
||||
ERROR("SendToPort: retrying write_port failed, port %ld, error %#lx (%s)\n", sendport, rv, strerror(rv));
|
||||
ERROR("SendToPort: retrying write_port failed, msgcode 0x%lx, port %ld, error %#lx (%s)\n", msgcode, sendport, rv, strerror(rv));
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
@ -150,7 +151,7 @@ status_t QueryPort(port_id requestport, int32 msgcode, request_data *request, in
|
||||
rv = write_port_etc(requestport, msgcode, request, requestsize, B_RELATIVE_TIMEOUT, TIMEOUT);
|
||||
|
||||
if (rv != B_OK) {
|
||||
ERROR("QueryPort: write_port failed, port %ld, error %#lx (%s)\n", requestport, rv, strerror(rv));
|
||||
ERROR("QueryPort: write_port failed, msgcode 0x%lx, port %ld, error %#lx (%s)\n", msgcode, requestport, rv, strerror(rv));
|
||||
if (rv == B_BAD_PORT_ID && requestport == MediaServerPort) {
|
||||
find_media_server_port();
|
||||
requestport = MediaServerPort;
|
||||
@ -163,7 +164,7 @@ status_t QueryPort(port_id requestport, int32 msgcode, request_data *request, in
|
||||
}
|
||||
rv = write_port_etc(requestport, msgcode, request, requestsize, B_RELATIVE_TIMEOUT, TIMEOUT);
|
||||
if (rv != B_OK) {
|
||||
ERROR("QueryPort: retrying write_port failed, port %ld, error %#lx (%s)\n", requestport, rv, strerror(rv));
|
||||
ERROR("QueryPort: retrying write_port failed, msgcode 0x%lx, port %ld, error %#lx (%s)\n", msgcode, requestport, rv, strerror(rv));
|
||||
_PortPool->PutPort(request->reply_port);
|
||||
return rv;
|
||||
}
|
||||
@ -173,7 +174,7 @@ status_t QueryPort(port_id requestport, int32 msgcode, request_data *request, in
|
||||
_PortPool->PutPort(request->reply_port);
|
||||
|
||||
if (rv < B_OK) {
|
||||
ERROR("QueryPort: read_port failed, port %ld, error %#lx (%s)\n", request->reply_port, rv, strerror(rv));
|
||||
ERROR("QueryPort: read_port failed, msgcode 0x%lx, port %ld, error %#lx (%s)\n", msgcode, request->reply_port, rv, strerror(rv));
|
||||
}
|
||||
|
||||
return (rv < B_OK) ? rv : reply->result;
|
||||
|
@ -125,7 +125,7 @@ void _SoundPlayNode::NodeRegistered(void)
|
||||
mOutput.format = mFormat;
|
||||
mOutput.destination = media_destination::null;
|
||||
mOutput.source.port = ControlPort();
|
||||
mOutput.source.id = 1;
|
||||
mOutput.source.id = 0;
|
||||
mOutput.node = Node();
|
||||
strcpy(mOutput.name, Name());
|
||||
|
||||
@ -212,12 +212,13 @@ _SoundPlayNode::GetNextOutput(int32* cookie, media_output* out_output)
|
||||
{
|
||||
CALLED();
|
||||
|
||||
if ((*cookie < 1) && (*cookie >= 0)) {
|
||||
if (*cookie == 0) {
|
||||
*out_output = mOutput;
|
||||
*cookie += 1;
|
||||
return B_OK;
|
||||
} else
|
||||
} else {
|
||||
return B_BAD_INDEX;
|
||||
}
|
||||
}
|
||||
|
||||
status_t
|
||||
@ -555,7 +556,7 @@ status_t
|
||||
_SoundPlayNode::SendNewBuffer(const media_timed_event *event, bigtime_t lateness, bool realTimeEvent)
|
||||
{
|
||||
CALLED();
|
||||
// printf("latency = %12Ld, event = %12Ld, sched = %5Ld, arrive at %12Ld, now %12Ld, current lateness %12Ld\n", EventLatency() + SchedulingLatency(), EventLatency(), SchedulingLatency(), event->event_time, TimeSource()->Now(), lateness);
|
||||
// printf("latency = %12Ld, event = %12Ld, sched = %5Ld, arrive at %12Ld, now %12Ld, current lateness %12Ld\n", EventLatency() + SchedulingLatency(), EventLatency(), SchedulingLatency(), event->event_time, TimeSource()->Now(), lateness);
|
||||
|
||||
// make sure we're both started *and* connected before delivering a buffer
|
||||
if ((RunState() != BMediaEventLooper::B_STARTED) || (mOutput.destination == media_destination::null))
|
||||
@ -566,7 +567,7 @@ _SoundPlayNode::SendNewBuffer(const media_timed_event *event, bigtime_t lateness
|
||||
// (based on EventLatency() and the SchedulingLatency()) to make this possible.
|
||||
// lateness is independent of EventLatency()!
|
||||
|
||||
if (lateness > 1000) {
|
||||
if (lateness > (BufferDuration() / 3) ) {
|
||||
printf("_SoundPlayNode::SendNewBuffer, event scheduled much too late, lateness is %Ld\n", lateness);
|
||||
}
|
||||
|
||||
@ -720,15 +721,12 @@ _SoundPlayNode::AllocateBuffers()
|
||||
size_t size = mOutput.format.u.raw_audio.buffer_size;
|
||||
int32 count = int32(mLatency / BufferDuration() + 1 + 1);
|
||||
|
||||
DPRINTF("\tlatency = %Ld, buffer duration = %Ld\n", mLatency, BufferDuration());
|
||||
DPRINTF("\tcreating group of %ld buffers, size = %lu\n", count, size);
|
||||
DPRINTF("\tlatency = %Ld, buffer duration = %Ld, count %ld\n", mLatency, BufferDuration(), count);
|
||||
|
||||
if (count < 3)
|
||||
count = 3;
|
||||
|
||||
if (count < 5)
|
||||
count = 5;
|
||||
|
||||
DPRINTF("\tcreating group of %ld buffers, size = %lu\n", count, size);
|
||||
mBufferGroup = new BBufferGroup(size, count);
|
||||
}
|
||||
|
||||
@ -743,12 +741,12 @@ _SoundPlayNode::FillNextBuffer(bigtime_t event_time)
|
||||
// if we fail to get a buffer (for example, if the request times out), we skip this
|
||||
// buffer and go on to the next, to avoid locking up the control thread
|
||||
if (!buf) {
|
||||
printf("RequestBuffer failed\n");
|
||||
ERROR("_SoundPlayNode::FillNextBuffer: RequestBuffer failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(buf->Data(), 0, mOutput.format.u.raw_audio.buffer_size);
|
||||
if(mPlayer->HasData()) {
|
||||
if (mPlayer->HasData()) {
|
||||
mPlayer->PlayBuffer(buf->Data(),
|
||||
mOutput.format.u.raw_audio.buffer_size, mOutput.format.u.raw_audio);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user