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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user