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))