<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I had a scenario where the frame was too large and the way I was handling it caused issues.</div><div><br></div><div>What I would really like to do is be able to increase the size of the frame buffer for future frames if I overrun it once. So I was calling "OutPacketBuffer::increaseMaxSizeTo(fFrameSize);" and tried adding a little bit too it. However, if I call this in the middle of processing a frame, then H264or5VideoRTPSink throws an error on line 252 "Access violation reading location"</div><div><br></div><div>Specifically: </div><div>I initially set OutPacketBuffer::maxSize = 600,000</div><div>A frame comes in that has a size of 616969, I call OutPacketBuffer::increaseMaxSizeTo(616969)</div><div><br></div><div>The next time it hits  memmove(fTo, &fInputBuffer[fCurDataOffset-numExtraHeaderBytes], numBytesToSend); in H264or5VideoRTPSink  there are no problems</div><div><br></div><div>However, when I encounter another frame larger than 600,000 specifically 601316 (so smaller than the new fMaxSize) then memmove in H264or5VideoRTPSink will throw an exception</div><div><br></div><div>Is there a way to increase fMaxSize midstream?</div><div><br></div><div>Here is my code.  Thanks!</div><div><br></div><div><div>if (fFrameSize > fMaxSize)</div><div>{</div><div><span style="white-space:pre"> </span>fNumTruncatedBytes = fFrameSize - fMaxSize - offset;</div><div><span style="white-space:pre">  </span>//OutPacketBuffer::increaseMaxSizeTo(fFrameSize+10);</div><div><span style="white-space:pre">  </span>memcpy(fTo, new_byte_pointer, fMaxSize - offset);</div><div>}</div><div>else</div><div>{</div><div><span style="white-space:pre">  </span>memcpy(fTo, new_byte_pointer, fFrameSize - offset);</div><div>}</div></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Matthew Czarnek</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>