From cae9b9d83a8318c86c7b8ab2f7f74422af3b0830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 20 Nov 2010 18:04:35 +0000 Subject: [PATCH] correctly initialize fStreamInfo[i].hasCookie git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39545 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/MediaExtractor.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/kits/media/MediaExtractor.cpp b/src/kits/media/MediaExtractor.cpp index 8b48172484..359bc6d5e3 100644 --- a/src/kits/media/MediaExtractor.cpp +++ b/src/kits/media/MediaExtractor.cpp @@ -82,7 +82,7 @@ MediaExtractor::MediaExtractor(BDataIO* source, int32 flags) for (int32 i = 0; i < fStreamCount; i++) { fStreamInfo[i].status = B_OK; fStreamInfo[i].cookie = 0; - fStreamInfo[i].hasCookie = true; + fStreamInfo[i].hasCookie = false; fStreamInfo[i].infoBuffer = 0; fStreamInfo[i].infoBufferSize = 0; fStreamInfo[i].chunkCache @@ -99,13 +99,14 @@ MediaExtractor::MediaExtractor(BDataIO* source, int32 flags) // create all stream cookies for (int32 i = 0; i < fStreamCount; i++) { - if (B_OK != fReader->AllocateCookie(i, &fStreamInfo[i].cookie)) { + if (fReader->AllocateCookie(i, &fStreamInfo[i].cookie) != B_OK) { fStreamInfo[i].cookie = 0; fStreamInfo[i].hasCookie = false; fStreamInfo[i].status = B_ERROR; ERROR("MediaExtractor::MediaExtractor: AllocateCookie for stream " "%ld failed\n", i); - } + } else + fStreamInfo[i].hasCookie = true; } // get info for all streams