lavc: move bitstream filter args to the bsf ctx

This commit is contained in:
Rodger Combs 2015-10-07 21:09:26 -05:00
parent 5740dc27e1
commit 0d53a6f5b4
3 changed files with 10 additions and 4 deletions

View File

@ -5026,6 +5026,11 @@ typedef struct AVBitStreamFilterContext {
struct AVBitStreamFilter *filter; struct AVBitStreamFilter *filter;
AVCodecParserContext *parser; AVCodecParserContext *parser;
struct AVBitStreamFilterContext *next; struct AVBitStreamFilterContext *next;
/**
* Internal default arguments, used if NULL is passed to av_bitstream_filter_filter().
* Not for access by library users.
*/
char *args;
} AVBitStreamFilterContext; } AVBitStreamFilterContext;

View File

@ -73,6 +73,7 @@ void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc)
if (bsfc->filter->close) if (bsfc->filter->close)
bsfc->filter->close(bsfc); bsfc->filter->close(bsfc);
av_freep(&bsfc->priv_data); av_freep(&bsfc->priv_data);
av_freep(&bsfc->args);
av_parser_close(bsfc->parser); av_parser_close(bsfc->parser);
av_free(bsfc); av_free(bsfc);
} }
@ -84,6 +85,6 @@ int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
{ {
*poutbuf = (uint8_t *)buf; *poutbuf = (uint8_t *)buf;
*poutbuf_size = buf_size; *poutbuf_size = buf_size;
return bsfc->filter->filter(bsfc, avctx, args, poutbuf, poutbuf_size, return bsfc->filter->filter(bsfc, avctx, args ? args : bsfc->args,
buf, buf_size, keyframe); poutbuf, poutbuf_size, buf, buf_size, keyframe);
} }

View File

@ -29,8 +29,8 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57 #define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 4 #define LIBAVCODEC_VERSION_MINOR 5
#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \