* Use NULL instead of 0 for some pointer initializations.

* Slightly more debug output for failed atempts to create a decoder.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25825 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2008-06-06 13:07:02 +00:00
parent 9639f1bf6c
commit ae4ebbcca6
2 changed files with 13 additions and 8 deletions

View File

@ -21,7 +21,7 @@ MediaExtractor::MediaExtractor(BDataIO *source, int32 flags)
{
CALLED();
fSource = source;
fStreamInfo = 0;
fStreamInfo = NULL;
fExtractorThread = -1;
fExtractorWaitSem = -1;
fTerminateExtractor = false;
@ -276,8 +276,11 @@ MediaExtractor::CreateDecoder(int32 stream, Decoder **out_decoder,
res = _plugin_manager.CreateDecoder(&decoder,
fStreamInfo[stream].encodedFormat);
if (res != B_OK) {
char formatString[256];
string_for_format(&fStreamInfo[stream].encodedFormat, formatString,
256);
ERROR("MediaExtractor::CreateDecoder _plugin_manager.CreateDecoder "
"failed for stream %ld\n", stream);
"failed for stream %ld, format: %s\n", stream, formatString);
return res;
}

View File

@ -708,11 +708,13 @@ BMediaTrack::BMediaTrack(BPrivate::media::MediaExtractor *extractor,
fErr = B_OK;
SetupWorkaround();
if (fExtractor->CreateDecoder(fStream, &fDecoder, &fMCI) != B_OK) {
TRACE("BMediaTrack::BMediaTrack: Error: creating decoder failed\n");
status_t ret = fExtractor->CreateDecoder(fStream, &fDecoder, &fMCI);
if (ret != B_OK) {
TRACE("BMediaTrack::BMediaTrack: Error: creating decoder failed: "
"%s\n", strerror(ret));
// we do not set fErr here, because ReadChunk should still work
fDecoder = 0;
fDecoder = NULL;
return;
}
@ -720,9 +722,9 @@ BMediaTrack::BMediaTrack(BPrivate::media::MediaExtractor *extractor,
fCurTime = 0;
// not used:
fEncoder = 0;
fEncoder = NULL;
fEncoderID = 0;
fWriter = 0;
fWriter = NULL;
}