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; }