{
LOAD_FORMATSPECIFIC_OGG();
+ //fprintf(stderr, "<");
+
if(!cls.capturevideo.soundrate)
{
for(;;)
// first: make sure we have a page of both types
if(!format->have_videopage)
if(qogg_stream_pageout(&format->to, &format->videopage) > 0)
+ {
+ //fprintf(stderr, "V");
format->have_videopage = true;
+
+ // why do I have to do this? the code should work without the
+ // following three lines, which turn this attempt at correct
+ // interleaving back into the old stupid one that oggz-validate
+ // hates
+ FS_Write(cls.capturevideo.videofile, format->videopage.header, format->videopage.header_len);
+ FS_Write(cls.capturevideo.videofile, format->videopage.body, format->videopage.body_len);
+ format->have_videopage = false;
+ }
if(!format->have_audiopage)
if(qogg_stream_pageout(&format->vo, &format->audiopage) > 0)
+ {
+ //fprintf(stderr, "A");
format->have_audiopage = true;
+ // why do I have to do this? the code should work without the
+ // following three lines, which turn this attempt at correct
+ // interleaving back into the old stupid one that oggz-validate
+ // hates
+ FS_Write(cls.capturevideo.videofile, format->audiopage.header, format->audiopage.header_len);
+ FS_Write(cls.capturevideo.videofile, format->audiopage.body, format->audiopage.body_len);
+ format->have_audiopage = false;
+ }
+
if(format->have_videopage && format->have_audiopage)
{
// output the page that ends first
FS_Write(cls.capturevideo.videofile, format->audiopage.header, format->audiopage.header_len);
FS_Write(cls.capturevideo.videofile, format->audiopage.body, format->audiopage.body_len);
format->have_audiopage = false;
+
+ //fprintf(stderr, "a");
}
else
{
FS_Write(cls.capturevideo.videofile, format->videopage.header, format->videopage.header_len);
FS_Write(cls.capturevideo.videofile, format->videopage.body, format->videopage.body_len);
format->have_videopage = false;
+
+ //fprintf(stderr, "v");
}
}
else
break;
}
+
+ fprintf(stderr, ">");
+
}
static void SCR_CaptureVideo_Ogg_FlushInterleaving()
while(num-- > 0)
{
qtheora_encode_YUVin(&format->ts, &format->yuv);
- qtheora_encode_packetout(&format->ts, false, &pt);
- qogg_stream_packetin(&format->to, &pt);
+
+ while(qtheora_encode_packetout(&format->ts, false, &pt))
+ qogg_stream_packetin(&format->to, &pt);
SCR_CaptureVideo_Ogg_Interleave();
}
while(qvorbis_bitrate_flushpacket(&format->vd, &pt))
qogg_stream_packetin(&format->vo, &pt);
-
- SCR_CaptureVideo_Ogg_Interleave();
}
+
+ SCR_CaptureVideo_Ogg_Interleave();
}
void SCR_CaptureVideo_Ogg_BeginVideo()