Resolve processing with older ffmpeg versions

This commit is contained in:
MrDave
2021-06-13 22:05:25 -06:00
committed by Mr-Dave
parent 02c9f823d9
commit 66d9315ef3
2 changed files with 8 additions and 11 deletions

View File

@@ -779,10 +779,8 @@ int myimage_fill_arrays(AVFrame *frame,uint8_t *buffer_ptr,enum MyPixelFormat pi
/*********************************************/
void mypacket_free(AVPacket *pkt)
{
#if (MYFFVER >= 58076)
#if (MYFFVER >= 57041)
av_packet_free(&pkt);
#elif (MYFFVER >= 57000)
av_packet_unref(pkt);
#else
av_free_packet(pkt);
#endif
@@ -817,12 +815,11 @@ int mycopy_packet(AVPacket *dest_pkt, AVPacket *src_pkt)
/*********************************************/
AVPacket *mypacket_alloc(AVPacket *pkt)
{
#if (MYFFVER >= 58076)
if (pkt != NULL) {
mypacket_free(pkt);
};
return av_packet_alloc();
#else
if (pkt != NULL) {
mypacket_free(pkt);
};
pkt = av_packet_alloc();
#if (MYFFVER < 58076)
av_init_packet(pkt);
pkt->data = NULL;
pkt->size = 0;