From 591ce51a9c241fe99256fe9cbb20807d7bfbcfc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 9 Jul 2009 13:04:40 +0000 Subject: [PATCH] Improved error logging. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31476 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../media_node_framework/video/VideoConsumer.cpp | 12 ++++++++---- .../media_node_framework/video/VideoProducer.cpp | 11 +++++++++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/apps/mediaplayer/media_node_framework/video/VideoConsumer.cpp b/src/apps/mediaplayer/media_node_framework/video/VideoConsumer.cpp index 65aafbae59..67c8764e9e 100644 --- a/src/apps/mediaplayer/media_node_framework/video/VideoConsumer.cpp +++ b/src/apps/mediaplayer/media_node_framework/video/VideoConsumer.cpp @@ -267,12 +267,16 @@ VideoConsumer::CreateBuffers(const media_format& format) BBuffer *buffer = NULL; if ((status = fBuffers->AddBuffer(info, &buffer)) != B_OK) { - ERROR("VideoConsumer::CreateBuffers - ERROR ADDING BUFFER TO GROUP\n"); + ERROR("VideoConsumer::CreateBuffers - ERROR ADDING BUFFER " + "TO GROUP (%ld): %s\n", i, strerror(status)); return status; - } else - PROGRESS("VideoConsumer::CreateBuffers - SUCCESSFUL ADD BUFFER TO GROUP\n"); + } else { + PROGRESS("VideoConsumer::CreateBuffers - SUCCESSFUL ADD " + "BUFFER TO GROUP\n"); + } } else { - ERROR("VideoConsumer::CreateBuffers - ERROR CREATING VIDEO RING BUFFER: %s\n", strerror(status)); + ERROR("VideoConsumer::CreateBuffers - ERROR CREATING VIDEO RING " + "BUFFER (%ld): %s\n", i, strerror(status)); return status; } } diff --git a/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp b/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp index d1b9ae12e3..8341461ca6 100644 --- a/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp +++ b/src/apps/mediaplayer/media_node_framework/video/VideoProducer.cpp @@ -280,8 +280,15 @@ VideoProducer::FormatProposal(const media_source& output, media_format* format) status_t ret = format_is_compatible(*format, fOutput.format) ? B_OK : B_MEDIA_BAD_FORMAT; - if (ret != B_OK) - ERROR("FormatProposal() error\n"); + if (ret != B_OK) { + ERROR("FormatProposal() error: %s\n", strerror(ret)); + char string[512]; + string_for_format(*format, string, sizeof(string)); + ERROR(" requested: %s\n", string); + string_for_format(fOutput.format, string, sizeof(string)); + ERROR(" output: %s\n", string); + } + // change any wild cards to specific values return ret;