From: Rudolf Polzer Date: Sun, 5 Jun 2011 19:25:36 +0000 (+0200) Subject: add a hack to always send increasing audio pts (taken from mplayer2 encoding code) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b9c42c71d0d56ebcf13342a4b4796f8802cbcc4d;p=xonotic%2Fdarkplaces.git add a hack to always send increasing audio pts (taken from mplayer2 encoding code) --- diff --git a/cap_lavc.c b/cap_lavc.c index 0f9482b7..edbd2405 100644 --- a/cap_lavc.c +++ b/cap_lavc.c @@ -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); }