Skip to content

Commit f96989b

Browse files
committed
Fix deprecated warnings into coded data class
1 parent 9bda038 commit f96989b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/AvTranscoder/data/coded/CodedData.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ CodedData& CodedData::operator=(const CodedData& other)
4343

4444
CodedData::~CodedData()
4545
{
46-
av_free_packet(&_packet);
46+
av_packet_unref(&_packet);
4747
}
4848

4949
void CodedData::resize(const size_t newSize)
@@ -75,7 +75,7 @@ void CodedData::refData(CodedData& frame)
7575

7676
void CodedData::clear()
7777
{
78-
av_free_packet(&_packet);
78+
av_packet_unref(&_packet);
7979
initAVPacket();
8080
}
8181

@@ -94,7 +94,9 @@ void CodedData::initAVPacket()
9494

9595
void CodedData::copyAVPacket(const AVPacket& avPacket)
9696
{
97-
#if AVTRANSCODER_FFMPEG_DEPENDENCY && LIBAVCODEC_VERSION_INT > AV_VERSION_INT(54, 56, 0)
97+
#if AVTRANSCODER_FFMPEG_DEPENDENCY && LIBAVCODEC_VERSION_MAJOR > 57
98+
av_packet_ref(&_packet, &avPacket);
99+
#elif AVTRANSCODER_FFMPEG_DEPENDENCY && LIBAVCODEC_VERSION_INT > AV_VERSION_INT(54, 56, 0)
98100
// Need const_cast<AVCodec*> for libav versions from 54.56. to 55.56.
99101
av_copy_packet(&_packet, const_cast<AVPacket*>(&avPacket));
100102
#else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy