solve the problem when video finished

This commit is contained in:
sirius 2019-10-30 22:26:45 +08:00
parent 9f009e0e04
commit 0a6edd02ca

View file

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