[FFmpeg-devel] [PATCH 5/6] h264_changesps_bsf: add and use init

Christophe Gisquet christophe.gisquet at gmail.com
Sun Nov 30 01:45:55 CET 2014


---
 libavcodec/h264_changesps_bsf.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libavcodec/h264_changesps_bsf.c b/libavcodec/h264_changesps_bsf.c
index a166748..43e0d62 100644
--- a/libavcodec/h264_changesps_bsf.c
+++ b/libavcodec/h264_changesps_bsf.c
@@ -398,6 +398,17 @@ static int find_next_nal_annexb(const uint8_t *src, int *p, int size)
     return 0;
 }
 
+static int h264_changesps_init(AVBitStreamFilterContext *bsfc, const char *args)
+{
+    H264SPSContext *ctx = bsfc->priv_data;
+    if (parse_args(ctx, args)) {
+        ctx->state = 1;
+        return 1;
+    }
+    ctx->state = 16;
+    return 0;
+}
+
 static int h264_changesps_filter(AVBitStreamFilterContext *bsfc,
                                  AVCodecContext *avctx, const char *args,
                                  uint8_t  **poutbuf, int *poutbuf_size,
@@ -601,4 +612,5 @@ AVBitStreamFilter ff_h264_changesps_bsf = {
     "h264_changesps",
     sizeof(H264SPSContext),
     h264_changesps_filter,
+    .init = h264_changesps_init,
 };
-- 
1.9.2.msysgit.0



More information about the ffmpeg-devel mailing list