avcodec/null_bsf: move the reference in the bsf internal buffer
authorJames Almer <jamrial@gmail.com>
Fri, 16 Mar 2018 22:51:08 +0000 (19:51 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 16 Mar 2018 22:51:08 +0000 (19:51 -0300)
There's no need to allocate a new packet for it.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/null_bsf.c

index feb7124..24d26df 100644 (file)
 #include "avcodec.h"
 #include "bsf.h"
 
-static int null_filter(AVBSFContext *ctx, AVPacket *out)
+static int null_filter(AVBSFContext *ctx, AVPacket *pkt)
 {
-    AVPacket *in;
-    int ret;
-
-    ret = ff_bsf_get_packet(ctx, &in);
-    if (ret < 0)
-        return ret;
-    av_packet_move_ref(out, in);
-    av_packet_free(&in);
-    return 0;
+    return ff_bsf_get_packet_ref(ctx, pkt);
 }
 
 const AVBitStreamFilter ff_null_bsf = {