There's no need to allocate a new packet for it.
Signed-off-by: James Almer <[email protected]>
---
libavcodec/chomp_bsf.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/libavcodec/chomp_bsf.c b/libavcodec/chomp_bsf.c
index cc94380535..0d29a9a1d9 100644
--- a/libavcodec/chomp_bsf.c
+++ b/libavcodec/chomp_bsf.c
@@ -25,18 +25,14 @@
static int chomp_filter(AVBSFContext *ctx, AVPacket *out)
{
- AVPacket *in;
int ret;
- ret = ff_bsf_get_packet(ctx, &in);
+ ret = ff_bsf_get_packet_ref(ctx, out);
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 (out->size > 0 && !out->data[out->size - 1])
+ out->size--;
return 0;
}
--
2.16.2
_______________________________________________
ffmpeg-devel mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel