Skip to content

Delayed optimization #21

@xixihao123

Description

@xixihao123

Hi, when I used the ffmpet push camera and then played RTSP video with player, I found that the delay was about 1 second, mainly caused by the displayRunnable() thread, and if deleted
for (;;)
{
const double delay = m_videoStartClock + current_frame.m_pts - GetHiResTime();
if (delay < 0.005)
break;
if (delay > 0.1)
{
boost::this_thread::sleep_for(
boost::chrono::milliseconds(100 * speedDenominator / speedNumerator));
continue;
}

        boost::this_thread::sleep_for(
            boost::chrono::milliseconds(int(delay * 1000. * speedDenominator / speedNumerator)));
        break;
    }

There will be no delay, but it will cause the audio and video to be out of sync.
How can we optimize it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions