From 3569b1e85d3ba1af15db2c5f0dc51a08543bd86b Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sat, 15 Sep 2012 14:07:12 +0200 Subject: [PATCH] Fix bug in videoomx delivermediapacket for big mediapackets --- videoomx.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/videoomx.cc b/videoomx.cc index 59d5d29..a6d6708 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -2187,6 +2187,7 @@ void VideoOMX::threadMethod() input_bufs_omx_mutex.Lock(); input_bufs_omx_free.push_back(pict); input_bufs_omx_mutex.Unlock(); + //Log::getInstance()->log("Video", Log::DEBUG, "threadMethod Frameskip"); } else { OMX_ERRORTYPE error = ProtOMXEmptyThisBuffer(omx_vid_dec, pict); @@ -2460,6 +2461,7 @@ UINT VideoOMX::DeliverMediaPacket(MediaPacket packet, unsigned int haveToCopy=packet.length-*samplepos; while (haveToCopy> (cur_input_buf_omx->nAllocLen-cur_input_buf_omx->nFilledLen)) { + //Log::getInstance()->log("Video", Log::DEBUG, "Big buffer %d %d %d",packet.length,cur_input_buf_omx->nAllocLen,cur_input_buf_omx->nFilledLen); unsigned int cancopy=cur_input_buf_omx->nAllocLen-cur_input_buf_omx->nFilledLen; memcpy(cur_input_buf_omx->pBuffer+cur_input_buf_omx->nFilledLen,buffer+packet.pos_buffer+*samplepos,cancopy); haveToCopy-=cancopy; @@ -2468,6 +2470,7 @@ UINT VideoOMX::DeliverMediaPacket(MediaPacket packet, // push old buffer out PutBufferToPres(cur_input_buf_omx, lastreftimeOMX,false); + cur_input_buf_omx=NULL; // get5 new buffer input_bufs_omx_mutex.Lock(); if (input_bufs_omx_free.size()==0) { -- 2.39.5