From 60c85abee5dbbab958ad83897dee761ec2cb5330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 30 Jul 2009 00:11:02 +0000 Subject: [PATCH] Resolved TODO, make it clear who maintains the allocation of the media_file_format array (it remains with the plugin itself, as with DecoderPlugins). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31955 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/media/WriterPlugin.h | 6 +----- src/kits/media/MediaDefs.cpp | 2 +- src/servers/media/AddOnManager.cpp | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/headers/private/media/WriterPlugin.h b/headers/private/media/WriterPlugin.h index ffb9adbb42..ef12d96859 100644 --- a/headers/private/media/WriterPlugin.h +++ b/headers/private/media/WriterPlugin.h @@ -56,12 +56,8 @@ public: // XXX for test programs only class WriterPlugin : public virtual MediaPlugin { public: virtual Writer* NewWriter() = 0; - // TODO: Perhaps change this interface to make it clear if we - // want the _fileFormats to be allocated! This is used in - // src/servers/media/AddOnManager.cpp:_RegisterWriter() and the - // objects are not freed by that method! virtual status_t GetSupportedFileFormats( - media_file_format** _fileFormats, + const media_file_format** _fileFormats, size_t* _count) = 0; }; diff --git a/src/kits/media/MediaDefs.cpp b/src/kits/media/MediaDefs.cpp index f7939f7dc2..9d35f21192 100644 --- a/src/kits/media/MediaDefs.cpp +++ b/src/kits/media/MediaDefs.cpp @@ -1185,7 +1185,7 @@ operator<(const media_file_format_id& a, const media_file_format_id& b) // #pragma mark - -//! Use this function iterate through available file format writers +//! Use this function to iterate through available file format writers. status_t get_next_file_format(int32* cookie, media_file_format* mff) { diff --git a/src/servers/media/AddOnManager.cpp b/src/servers/media/AddOnManager.cpp index 2970ff2355..463b4c17d3 100644 --- a/src/servers/media/AddOnManager.cpp +++ b/src/servers/media/AddOnManager.cpp @@ -421,7 +421,7 @@ AddOnManager::_RegisterWriter(WriterPlugin* writer, const entry_ref& ref) info.internalID = fNextWriterFormatFamilyID++; // Get list of support media_file_formats... - media_file_format* fileFormats = NULL; + const media_file_format* fileFormats = NULL; size_t count = 0; if (writer->GetSupportedFileFormats(&fileFormats, &count) != B_OK) { printf("AddOnManager::_RegisterWriter(): "