From 0a6edd02ca7b171c66b3953fb8a1ea7dd7cc8775 Mon Sep 17 00:00:00 2001 From: sirius Date: Wed, 30 Oct 2019 22:26:45 +0800 Subject: [PATCH] solve the problem when video finished --- src/engine/client/video.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/engine/client/video.cpp b/src/engine/client/video.cpp index c24714518..909cc217b 100644 --- a/src/engine/client/video.cpp +++ b/src/engine/client/video.cpp @@ -685,7 +685,8 @@ void CVideo::finish_frames(OutputStream* pStream) if (!ret_recv) { /* rescale output packet timestamp values from codec to stream timebase */ - av_packet_rescale_ts(&Packet, pStream->enc->time_base, pStream->st->time_base); + if(pStream->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) + av_packet_rescale_ts(&Packet, pStream->st->codec->time_base, pStream->st->time_base); Packet.stream_index = pStream->st->index; if (int ret = av_interleaved_write_frame(m_pFormatContext, &Packet))