<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<div><br></div>I'm moving this private correspondence to the mailing list since it was only accidentally made private by me...<div><br><br>> Date: Thu, 11 Feb 2010 03:53:25 -0500<br>> From: tterribe@email.unc.edu<br>> <br>> Id Kong wrote:<br>> >>> times, as most of these frames will be very small). You need to write<br>> >>> out pages in a loop so long as there are pages ready to be written,<br>> >>> instead of just writing 0 or 1 pages after each packet.> <br>> <br>> > I based my code off of encoder_example.c ! This is why I need you to be<br>> > specific. The problem with the example code is that it's enormously<br>> <br>> I thought the above was specific. You need to put WriteOggPage in a loop<br>> instead of calling it once per frame. This applies to the headers as well.<br><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>I'm sorry, I didn't read your post carefully enough. So, what you're saying is that not only do th_encode_packetout() and ogg_stream_packetin() need to be called in a loop but ogg_stream_pageout() needs to be called in a (different) loop as well, right?</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Incidentally, encoder_example.c does not do this. If I'm reading the code right, there is only one call to ogg_stream_pageout() for every loop of th_encode_packetout() and ogg_stream_packetin() calls.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>I tried changing WriteOggPacket() like so:</div><div><br></div><div><br></div><div><div>void WriteOggPage(FILE *file, ogg_stream_state *state, bool flush = false) {</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ogg_page page;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>while(true) {</div><div style="text-indent: 0in !important; "><span class="Apple-tab-span" style="text-indent: 0in !important; white-space: pre; ">                </span>int rc;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if( flush ) rc = ogg_stream_flush( state, &page);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>else rc = ogg_stream_pageout(state, &page);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if( rc == 0 ) {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>break;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>} else {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>fwrite(page.header, 1, page.header_len, file);</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>fwrite(page.body, 1, page.body_len, file);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div>}</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>This resulted in a slight larger file but no discernible difference in the movie play length. It's certainly not playing the expected duration.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>What do you think?</div><div><br></div></div><div><br></div><div>> > Hey, is this a private e-mail correspondence? How do I reply to the group?<br>> <br>> Reply to theora-dev@xiph.org. The list is not configured to do this by<br>> default (don't ask me why).<br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Okay, so I won't ask you but someone should have some reason for doing this. How often do you want to respond to the group rather than responding privately to another member of the group?</div><div><br></div><div><br></div>                                            <br /><hr />All your Hotmail contacts on your phone. <a href='http://go.microsoft.com/?linkid=9708118' target='_new'>Try it now.</a></body>
</html>