From f0c88a50ba6408101d43a0993b4a608c91006505 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Tue, 11 Mar 2008 21:00:27 +0000 Subject: [PATCH] * The flavor info needs to initialize the output format count to 0 too, as otherwise the addon server tries to allocate to much memory. * Use a member variable for the input media_format Thx to Ingo for pointing this out git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24362 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../media/media-add-ons/videowindow/VideoAddOn.cpp | 13 +++++++++---- .../media/media-add-ons/videowindow/VideoAddOn.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp b/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp index d1edd82b29..e8a08bdb40 100644 --- a/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp +++ b/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.cpp @@ -18,6 +18,10 @@ VideoWindowAddOn::VideoWindowAddOn(image_id id) : BMediaAddOn(id) { CALLED(); + + fInputFormat.type = B_MEDIA_RAW_VIDEO; + fInputFormat.u.raw_video = media_raw_video_format::wildcard; + fInfo.internal_id = 0; fInfo.name = strdup("VideoWindow Consumer"); fInfo.info = strdup("This node displays a simple video window"); @@ -25,10 +29,11 @@ VideoWindowAddOn::VideoWindowAddOn(image_id id) fInfo.flavor_flags = 0; fInfo.possible_count = 0; fInfo.in_format_count = 1; - media_format *inFormat = new media_format; - inFormat->type = B_MEDIA_RAW_VIDEO; - inFormat->u.raw_video = media_raw_video_format::wildcard; - fInfo.in_formats = inFormat; + fInfo.in_format_flags = 0; + fInfo.in_formats = &fInputFormat; + fInfo.out_format_count = 0; + fInfo.out_formats = 0; + fInfo.out_format_flags = 0; } diff --git a/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h b/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h index ef6b85ec55..c1df3e0511 100644 --- a/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h +++ b/src/add-ons/media/media-add-ons/videowindow/VideoAddOn.h @@ -24,6 +24,7 @@ public: private: flavor_info fInfo; + media_format fInputFormat; }; extern "C" BMediaAddOn *make_media_addon(image_id id);