From a8a3e4242bd52f85265eaba3e2b4fd0bfd254bdb Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 24 Feb 2023 21:52:05 +0100 Subject: [PATCH] rtsp: request keyframe exactly once --- output/rtsp/rtsp.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/output/rtsp/rtsp.cc b/output/rtsp/rtsp.cc index ee13c2c..cb673e9 100644 --- a/output/rtsp/rtsp.cc +++ b/output/rtsp/rtsp.cc @@ -70,20 +70,15 @@ public: return; // we're not ready for the data yet } - if (buf->flags.is_keyframe) { - fHadKeyFrame = true; - } - - if (!fRequestedKeyFrame) { - if (!fHadKeyFrame) { - printf("device_video_force_key: %p\n", this); - device_video_force_key(buf->buf_list->dev); - } - - fRequestedKeyFrame = true; + if (!fHadKeyFrame) { + fHadKeyFrame = buf->flags.is_keyframe; } if (!fHadKeyFrame) { + if (!fRequestedKeyFrame) { + device_video_force_key(buf->buf_list->dev); + fRequestedKeyFrame = true; + } return; }