[FFmpeg-devel] [PATCH] Remove last deprecated calls

Felt, Patrick Patrick.Felt at echostar.com
Tue Jun 28 05:22:29 CEST 2016

From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> on behalf of Marton Balint <cus at passwd.hu>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
Date: Monday, June 27, 2016 at 6:01 PM
To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Remove last deprecated calls

On Mon, 27 Jun 2016, Felt, Patrick wrote:

libavdevice/decklink_dec.cpp | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 7412727..9c5d5f9 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -120,10 +120,6 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)
         av_log(q->avctx, AV_LOG_WARNING,  "Decklink input buffer overrun!\n");
         return -1;
-    /* duplicate the packet */
-    if (av_dup_packet(pkt) < 0) {
-        return -1;
-    }

I don't think you can remove this, pkt.data needs to be memcpy-ed to a
newly allocated buffer.

It appears to run cleanly on my test system, but I’d be happy to put it back.  Would the following be the right thing in this case?  (I don’t fully understand what that function was intending to do originally; the replacement makes a bit more sense to me).

if (av_packet_ref(pkt, pkt) < 0) {
  return -1;

though it seems that might only be valid if the whole of decklink was using reference counted packets?  Does that function do the memcpy() you were thinking we needed?

More information about the ffmpeg-devel mailing list