Commit 27d4249f authored by James Almer's avatar James Almer

avcodec/chomp: move the reference in the bsf internal buffer

There's no need to allocate a new packet for it.
Reviewed-by: 's avatarMark Thompson <sw@jkqxz.net>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 8fb0e51b
......@@ -23,20 +23,16 @@
#include "bsf.h"
#include "internal.h"
static int chomp_filter(AVBSFContext *ctx, AVPacket *out)
static int chomp_filter(AVBSFContext *ctx, AVPacket *pkt)
{
AVPacket *in;
int ret;
ret = ff_bsf_get_packet(ctx, &in);
ret = ff_bsf_get_packet_ref(ctx, pkt);
if (ret < 0)
return ret;
while (in->size > 0 && !in->data[in->size - 1])
in->size--;
av_packet_move_ref(out, in);
av_packet_free(&in);
while (pkt->size > 0 && !pkt->data[pkt->size - 1])
pkt->size--;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment