]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
add a hack to always send increasing audio pts (taken from mplayer2 encoding code)
authorRudolf Polzer <divverent@xonotic.org>
Sun, 5 Jun 2011 19:25:36 +0000 (21:25 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 5 Jun 2011 19:25:36 +0000 (21:25 +0200)
cap_lavc.c

index 0f9482b7358560f9bb27e937d478de63c7601952..edbd24053cb6054ef663006f5a8796c55e0b4d2d 100644 (file)
@@ -936,7 +936,7 @@ static void SCR_CaptureVideo_Lavc_VideoFrames(int num)
                {
                        AVPacket packet;
                        qav_init_packet(&packet);
-                       packet.stream_index = 0;
+                       packet.stream_index = format->avf->streams[0]->index;
                        packet.data = format->buffer;
                        packet.size = size;
                        if (avc->coded_frame->key_frame)
@@ -1038,6 +1038,9 @@ static void SCR_CaptureVideo_Lavc_SoundFrame_EncodeEnd(void)
                        if(qav_interleaved_write_frame(format->avf, &packet) < 0)
                                Con_Printf("error writing\n");
                }
+
+               // don't ask...
+               format->apts += format->aframesize;
        }
        while(size > 0);
 }