From b9c42c71d0d56ebcf13342a4b4796f8802cbcc4d Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 5 Jun 2011 21:25:36 +0200 Subject: [PATCH] add a hack to always send increasing audio pts (taken from mplayer2 encoding code) --- cap_lavc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.39.2