From 7a8c70a3c86890918e742457cba2db3351786801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20G=C3=BCnther?= Date: Thu, 7 Aug 2014 19:06:01 +0200 Subject: [PATCH] dvb.media_addon: Trigger loading of media plugins. - This is the workaround as described in the bug report #11018. - I would have preferred to place this workaround in DVBMediaAddon::InitCheck() as this method can return a status code but unfortunately it is never called. --- .../media/media-add-ons/dvb/DVBMediaAddon.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/add-ons/media/media-add-ons/dvb/DVBMediaAddon.cpp b/src/add-ons/media/media-add-ons/dvb/DVBMediaAddon.cpp index b201a8fc1a..f1f25f2f99 100644 --- a/src/add-ons/media/media-add-ons/dvb/DVBMediaAddon.cpp +++ b/src/add-ons/media/media-add-ons/dvb/DVBMediaAddon.cpp @@ -55,6 +55,20 @@ make_media_addon(image_id id) DVBMediaAddon::DVBMediaAddon(image_id id) : BMediaAddOn(id) { + // TODO: The following code block is a workaround for the bug #11018 + // (https://dev.haiku-os.org/ticket/11018). Please remove this code block, + // once the bug is being resolved. + // The workaround triggers the loading of all media plugins prior to using + // methods of class BMediaFormats. Using the function get_next_encoder() + // is used because of two facts + // 1. It is publicly available and thus can be used by 3rd party apps, + // too. + // 2. It is already available by including BMediaFormats.h, so there is + // no need to include another header for this workaround. + int32 workaroundCookie = 0; + media_codec_info workaroundMediaCodecInfo; + get_next_encoder(&workaroundCookie, &workaroundMediaCodecInfo); + ScanFolder("/dev/dvb"); } @@ -68,10 +82,12 @@ DVBMediaAddon::~DVBMediaAddon() status_t DVBMediaAddon::InitCheck(const char ** out_failure_text) { + debugger(""); if (!fDeviceList.CountItems()) { *out_failure_text = "No supported device found"; return B_ERROR; } + return B_OK; }