Skip to content

Reader: enable process with a generator #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

cchampet
Copy link
Member

No description provided.

Clement Champetier added 10 commits March 24, 2016 18:25
…o decode

* New attribute: _continueWithGenerator
* New method: continueWithGenerator
To be able to generate data (ie silence or black) when there is no more
data to decode.
…empty frame

* New attribute: _emptyFrame
* This commit avoids issue when dstFrame was clear and we need to
generate data after this instruction. The dstFrame must not be updated
in this case!
* Unused.
* Warning: after this instruction, we have to set again all fields of
the Frame to use it. It is easier to create a new Frame.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 73.715% when pulling 5c31e92 on cchampet:dev_readerProcessGenerator into 1b8bce2 on avTranscoder:develop.

else
{
_generator->decodeNextFrame(*_srcFrame);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could have done :

// generate data (ie silence or black)
if(_continueWithGenerator)
{
    _generator->decodeNextFrame(*_srcFrame);
}
// or return an empty frame
else
{
    _dstFrame->clear();
    return _dstFrame;
}

or

// return an empty frame
if(!_continueWithGenerator)
{
    _dstFrame->clear();
    return _dstFrame;
}
// or generate data (ie silence or black)
_generator->decodeNextFrame(*_srcFrame);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here 7dd618a

Avoid 'if not'/'else': 'if'/'else' is easier.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 73.715% when pulling 7dd618a on cchampet:dev_readerProcessGenerator into 1b8bce2 on avTranscoder:develop.

@cchampet
Copy link
Member Author

cchampet commented Apr 1, 2016

See PR #239

@cchampet cchampet closed this Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants