From a8b447be656145c9ba2a2d8319a10ae8f726de1f Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 09 十月 2020 18:20:46 +0800
Subject: [PATCH] h264 mp4

---
 csrc/worker/decoder.cpp |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/csrc/worker/decoder.cpp b/csrc/worker/decoder.cpp
index a57cf0e..5e8a7c9 100644
--- a/csrc/worker/decoder.cpp
+++ b/csrc/worker/decoder.cpp
@@ -57,7 +57,6 @@
 
         std::lock_guard<std::mutex> l(mutex_pkt_);
         if (data->getAVPacket().flags & AV_PKT_FLAG_KEY){
-            logIt("new list cpacket start, next %lld, cur %lld", next_idx_, pkt.id);
             list_pkt_.clear();
         }
         list_pkt_.push_back(pkt);
@@ -66,6 +65,8 @@
     }
 
     void decoder::GetFrame(unsigned char **data, int *w, int *h, int *format, int *length, int64_t *id){
+        *data = NULL;
+        *length = 0;
 
         AVFrame *frame = NULL;
 
@@ -75,13 +76,11 @@
             auto check = list_pkt_.front();
             if (check.id > next_idx_){
                 next_idx_ = -1;
-                logIt("decoder new list cpacket");
             }
             
             for (auto &i : list_pkt_){
                 if (i.id < next_idx_){
                     continue;
-                    logIt("decoder same list cpacket");
                 }
 
                 *id = i.v_id;

--
Gitblit v1.8.0