Commit 1b635e8c authored by Tristan Matthews's avatar Tristan Matthews

* #20603: daemon: fix fast picture update

pict_type must be reset immediately after the I-frame has been sent.
parent 19af062a
......@@ -55,7 +55,7 @@ void VideoRtpSession::updateSDP(const Sdp &sdp)
// if port has changed
if (not desc.empty() and desc != rxArgs_["receiving_sdp"]) {
rxArgs_["receiving_sdp"] = desc;
DEBUG("Updated incoming SDP to:\n %s",
DEBUG("Updated incoming SDP to:\n%s",
rxArgs_["receiving_sdp"].c_str());
}
......
......@@ -517,14 +517,21 @@ bool VideoSendThread::captureFrame()
void VideoSendThread::encodeAndSendVideo()
{
if (forceKeyFrame_ > 0) {
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53, 20, 0)
if (forceKeyFrame_ > 0) {
scaledInput_->pict_type = AV_PICTURE_TYPE_I;
atomic_decrement(&forceKeyFrame_);
} else if (scaledInput_->pict_type == AV_PICTURE_TYPE_I) {
scaledInput_->pict_type = AV_PICTURE_TYPE_NONE;
}
#else
if (forceKeyFrame_ > 0) {
scaledInput_->pict_type = FF_I_TYPE;
#endif
atomic_decrement(&forceKeyFrame_);
} else if (scaledInput_->pict_type == FF_I_TYPE) {
scaledInput_->pict_type = (AVPictureType) 0;
}
#endif
const int encodedSize = avcodec_encode_video(encoderCtx_, encoderBuffer_,
encoderBufferSize_, scaledInput_);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment