From 18a05d269516a5e33d8460291c2f93e73d95adce Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期二, 26 十二月 2023 10:45:31 +0800
Subject: [PATCH] GetYUV format is NV12

---
 csrc/worker/stream.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/csrc/worker/stream.cpp b/csrc/worker/stream.cpp
index 94e5ac3..92bc032 100644
--- a/csrc/worker/stream.cpp
+++ b/csrc/worker/stream.cpp
@@ -30,8 +30,11 @@
             
             std::lock_guard<std::mutex> locker(mutex_avpkt_);
             list_pkt_.push_back(pkt);
-            
             while(list_pkt_.size() > max_size_/2*3){
+                CPacket &tmpkt = list_pkt_.front();
+                if (tmpkt.data->getAVPacket().flags & AV_PKT_FLAG_KEY){
+                    break;
+                }
                 list_pkt_.pop_front();
             }
 

--
Gitblit v1.8.0