Skip to content

Instantly share code, notes, and snippets.

@rcombs

rcombs/stdin Secret

Created October 10, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcombs/54502b14f406bf6737e8 to your computer and use it in GitHub Desktop.
Save rcombs/54502b14f406bf6737e8 to your computer and use it in GitHub Desktop.
commit 473085b569b9501c9b23cf3cf2fddef98399bb70
Author: Rodger Combs <rodger.combs@gmail.com>
Date: Wed Oct 7 21:09:26 2015 -0500
lavc: move bitstream filter args to the bsf ctx
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ff70d25..22a68fb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -5026,6 +5026,11 @@ typedef struct AVBitStreamFilterContext {
struct AVBitStreamFilter *filter;
AVCodecParserContext *parser;
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;
diff --git a/libavcodec/bitstream_filter.c b/libavcodec/bitstream_filter.c
index a4e437d..fb690b6 100644
--- a/libavcodec/bitstream_filter.c
+++ b/libavcodec/bitstream_filter.c
@@ -73,6 +73,7 @@ void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc)
if (bsfc->filter->close)
bsfc->filter->close(bsfc);
av_freep(&bsfc->priv_data);
+ av_freep(&bsfc->args);
av_parser_close(bsfc->parser);
av_free(bsfc);
}
@@ -84,6 +85,6 @@ int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
{
*poutbuf = (uint8_t *)buf;
*poutbuf_size = buf_size;
- return bsfc->filter->filter(bsfc, avctx, args, poutbuf, poutbuf_size,
- buf, buf_size, keyframe);
+ return bsfc->filter->filter(bsfc, avctx, args ? args : bsfc->args,
+ poutbuf, poutbuf_size, buf, buf_size, keyframe);
}
diff --git a/libavcodec/version.h b/libavcodec/version.h
index a89ad91..c7fc1f1 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 4
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR 5
+#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment