fix, supplement to fb13b064fb8eb58c500e38698ebedc8b47c25108

Origin commit data
------------------
Branch: master
Commit: c35b633e1d
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2021-10-27 (Wed, 27 Oct 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2021-10-27 21:25:30 +02:00
committed by vanhofen
parent 5a8bbae8bd
commit 048116d7cc
5 changed files with 69 additions and 0 deletions

View File

@@ -58,6 +58,16 @@ static ao_sample_format sformat;
static AVCodecContext *c = NULL;
static AVCodecParameters *p = NULL;
#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
cAudio::cAudio(void *, void *, void *)
{
@@ -381,6 +391,8 @@ void cAudio::run()
curr_pts = 0;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 133, 100)
av_init_packet(&avpkt);
#else
get_packet_defaults(&avpkt);
#endif
inp = av_find_input_format("mpegts");
AVIOContext *pIOCtx = avio_alloc_context(inbuf, INBUF_SIZE, // internal Buffer and its size