title: C++ buffer with Qt
body: <p>I made a videoplayer with <code>Qt</code>, <code>OpenGl</code> and <code>FFMpeg</code> which works quite well.</p>
  
  <p>Now I want to use multi-threading and a buffer to have better performances. I've set up a thread which decode the frames and store it in a QMap :</p>
  
  <pre><code>QMap&lt;int, uint8_t *&gt; myBuffer;
  </code></pre>
  
  <p>The first int being the timecode and the second point to the OpenGl Texture.</p>
  
  <p>Everytime I decode a frame, I add it to the buffer using <code>new</code> and as soon as the frame is read, I <code>delete</code> it.</p>
  
  <p>Is assume this is not the best way to do it, not in term of memory management (no memory leak) but in term of performance.</p>
  
  <p>Is there a better approach to do this ?</p>