From 97302390a09488e9e52150f40196f06436fd4d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20G=C3=BCnther?= Date: Thu, 7 Aug 2014 19:18:53 +0200 Subject: [PATCH] dvb.media_addon: Remove superflous init check. - This init check prevented the MediaStreamDecoder from setting up an input format. The values the init check is based on are initialized by the first call to BMediaDecoder::SetTo() as described in the BeBook ("If you use the empty form of the constructor, you'll have to call SetTo() to establish the format to be decoded before calling Decode()"). But MediaStreamDecoder doesn't provide a public way to call BMediaDecoder::SetTo() first. There are at least two possible solutions to remedy this situation: 1. Remove the init check 2. Add a public way to call SetTo() The first solution was chosen for the following reason: Least amount of code change needed as it is an implementation detail so no client code has to be touched. The second solution might make sence when you want to stick to the BeBook where a clear distinction between SetTo() and SetInputFormat() is made, but as the current MediaStreamDecoder implementation doesn't stick to the BeBook anyway there is less need to add another method at this time. --- src/add-ons/media/media-add-ons/dvb/MediaStreamDecoder.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/add-ons/media/media-add-ons/dvb/MediaStreamDecoder.cpp b/src/add-ons/media/media-add-ons/dvb/MediaStreamDecoder.cpp index 6873899a57..e8da7074b3 100644 --- a/src/add-ons/media/media-add-ons/dvb/MediaStreamDecoder.cpp +++ b/src/add-ons/media/media-add-ons/dvb/MediaStreamDecoder.cpp @@ -11,10 +11,6 @@ MediaStreamDecoder::MediaStreamDecoder(get_next_chunk_func next_chunk, void *coo status_t MediaStreamDecoder::SetInputFormat(const media_format &in_format) { - status_t err = BMediaDecoder::InitCheck(); - if (err) - return err; - return BMediaDecoder::SetTo(&in_format); }