I write this small piece of code, that get pixels and encode them:<br><br>&nbsp;&nbsp;&nbsp; ogg_page&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; page;<br>&nbsp;&nbsp;&nbsp; ogg_packet&nbsp;&nbsp;&nbsp;&nbsp; packet;<br><br>&nbsp;&nbsp;&nbsp; m_frameSource.getYUVBits(m_buffer.y, m_buffer.u, m_buffer.v);<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; theora_encode_YUVin(&amp;m_encoder, &amp;m_buffer);<br>
<br>&nbsp;&nbsp;&nbsp; while(theora_encode_packetout(&amp;m_encoder, isLastFrame, &amp;packet))<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ogg_stream_packetin(&amp;m_oggStream, &amp;packet);<br><br>&nbsp;&nbsp;&nbsp; while (ogg_stream_pageout(&amp;m_oggStream, &amp;page)) <br>&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fwrite(page.header,page.header_len, 1, m_oggFile);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fwrite(page.body,page.body_len, 1, m_oggFile);<br>&nbsp;&nbsp;&nbsp; }<br><br>This piece of code runs in real-time. I want to remove the last while block and save theora packets directly to a temporary file. Then when capture is finished I read packets from temp file and send them to ogg_stream_pageout. Does this solution improve performance?<br>