Skip to content
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

calling the continuation method even on frame alloc failure #12167

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/uvc-sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,22 @@ void uvc_sensor::open( const stream_profiles & requests )

fh->set_timestamp_domain( timestamp_domain );
fh->set_stream( req_profile_base );
}
else
{
LOG_INFO( "Dropped frame. alloc_frame(...) returned nullptr" );
return;
}

diff = environment::get_instance().get_time_service()->get_time() - system_time;
if( diff > 10 )
LOG_DEBUG( "!! Frame memcpy took " << diff << " msec" );
diff = environment::get_instance().get_time_service()->get_time() - system_time;
if (diff > 10)
LOG_DEBUG("!! Frame memcpy took " << diff << " msec");
}

// calling the continuation method, and releasing the backend frame buffer
// since the content of the OS frame buffer has been copied, it can released ASAP
continuation();

if (!fh.frame)
{
LOG_INFO("Dropped frame. alloc_frame(...) returned nullptr");
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe better to move the memcpy log to after this block (without moving the time setting itself)?

if( diff > 10 )
                        LOG_DEBUG( "!! Frame memcpy took " << diff << " msec" );

Otherwise we might see a weird like

!! Frame memcpy took " << diff << " msec
Dropped frame. alloc_frame(...) returned nullptr

}

if( fh->get_stream().get() )
{
// Gather info for logging the callback ended
Expand Down