mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-27 21:40:34 +00:00
avcodec/dump_extradata_bsf: don't allocate a new AVPacket per filtered packet
~4x speedup in dump_extradata() Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
c9118d4d64
commit
b98bd60bfa
@ -34,16 +34,17 @@ enum DumpFreq {
|
||||
|
||||
typedef struct DumpExtradataContext {
|
||||
const AVClass *class;
|
||||
AVPacket pkt;
|
||||
int freq;
|
||||
} DumpExtradataContext;
|
||||
|
||||
static int dump_extradata(AVBSFContext *ctx, AVPacket *out)
|
||||
{
|
||||
DumpExtradataContext *s = ctx->priv_data;
|
||||
AVPacket *in;
|
||||
AVPacket *in = &s->pkt;
|
||||
int ret = 0;
|
||||
|
||||
ret = ff_bsf_get_packet(ctx, &in);
|
||||
ret = ff_bsf_get_packet_ref(ctx, in);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -72,7 +73,7 @@ static int dump_extradata(AVBSFContext *ctx, AVPacket *out)
|
||||
}
|
||||
|
||||
fail:
|
||||
av_packet_free(&in);
|
||||
av_packet_unref(in);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user