-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix manual demands on ended inputs #117
Conversation
fbd6cf7
to
98a6316
Compare
98a6316
to
2f71e9d
Compare
if SamplesQueue.empty?(cache) do | ||
if processing_finished? do | ||
end_of_streams = generate_output_end_of_streams(ctx) | ||
if SamplesQueue.empty?(cache) and processing_finished? do | ||
end_of_streams = generate_output_end_of_streams(ctx) | ||
|
||
{end_of_streams, state} | ||
else | ||
{[redemand: output_pad], state} | ||
end | ||
{end_of_streams, state} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this still doesn't guarantee we don't demand on an EOSed pad
- are you sure we never need this redemand here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change this particular clause at all just to be clear, and yes we don't need to do redemand in this case because there is no input pad left and the SampleQueue
is empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this still doesn't guarantee we don't demand on an EOSed pad
why is that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When processing_finished?
is false, some input pads are still left. Previously we redemanded when processing_finished?
was false
. Now we don't unless I'm missing something.
this still doesn't guarantee we don't demand on an EOSed pad why is that?
Redemanding means that handle_demand is executed immediately if there's still some demand on output. But if we don't redemand, handle_demand can still be executed right away - it's up to the framework. In that case, your change doesn't make any difference from the current behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generate_end_of_stream_segment
sends redemand
so it stays the same and also mark pad as ended by setting endtimestamp
to nil
so it should help with issue of demands of ended pads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when it comes to demanding withoug redemand
the only situation in which we don't send redemand is when we send end of stream on output
No description provided.