fix, supplement to 6045e1082c

This commit is contained in:
Jacek Jendrzej
2021-10-27 14:24:33 +02:00
parent 6045e1082c
commit 95a9258217
4 changed files with 49 additions and 0 deletions

View File

@@ -946,6 +946,16 @@ bool CStreamStream::Stop()
interrupt = false;
return (ret == 0);
}
#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(58, 133, 100)
static void get_packet_defaults(AVPacket *pkt)
{
memset(pkt, 0, sizeof(*pkt));
pkt->pts = AV_NOPTS_VALUE;
pkt->dts = AV_NOPTS_VALUE;
pkt->pos = -1;
}
#endif
void CStreamStream::run()
{
@@ -960,6 +970,8 @@ void CStreamStream::run()
while (!stopped) {
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 133, 100)
av_init_packet(&pkt);
#else
get_packet_defaults(&pkt);
#endif
if (av_read_frame(ifcx, &pkt) < 0)
break;