Skip to content

Commit

Permalink
- fix ffmpeg 4.4 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcor committed May 17, 2021
1 parent 0c7abe4 commit ac5f7ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 2 additions & 8 deletions src/sfeMovie/Demuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,19 +353,13 @@ namespace sfe
{
sf::Lock l(m_synchronized);

AVPacket *pkt = nullptr;
int err = 0;

pkt = (AVPacket *)av_malloc(sizeof(*pkt));
AVPacket* pkt = av_packet_alloc();
if (pkt == nullptr)
{
return nullptr;
}
av_init_packet(pkt);

err = av_read_frame(m_formatCtx, pkt);

if (err < 0)
if (av_read_frame(m_formatCtx, pkt) < 0)
{
av_packet_unref(pkt);
av_free(pkt);
Expand Down
6 changes: 1 addition & 5 deletions src/sfeMovie/Stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,7 @@ namespace sfe
{
if (m_codecCtx->codec->capabilities & AV_CODEC_CAP_DELAY)
{
AVPacket* flushPacket = (AVPacket*)av_malloc(sizeof(*flushPacket));
av_init_packet(flushPacket);
flushPacket->data = nullptr;
flushPacket->size = 0;
result = flushPacket;
result = av_packet_alloc();
}
}

Expand Down

0 comments on commit ac5f7ec

Please sign in to comment.