]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/hapqa_extract_bsf.c
avformat/dashdec: remove unused functions and process code
[ffmpeg] / libavcodec / hapqa_extract_bsf.c
index 333efb2e3a41cb3b963f0a220da8a025bd66a921..5c22184813ddf302aad5fa534c055d6b5556b531 100644 (file)
@@ -66,6 +66,7 @@ static int hapqa_extract(AVBSFContext *bsf, AVPacket *pkt)
 
     if ((section_type & 0x0F) != 0x0D) {
         av_log(bsf, AV_LOG_ERROR, "Invalid section type for HAPQA %#04x.\n", section_type & 0x0F);
+        ret = AVERROR_INVALIDDATA;
         goto fail;
     }
 
@@ -90,6 +91,7 @@ static int hapqa_extract(AVBSFContext *bsf, AVPacket *pkt)
 
         if (check_texture(ctx, section_type) == 0){ /* the second texture is not the one to keep */
             av_log(bsf, AV_LOG_ERROR, "No valid texture found.\n");
+            ret = AVERROR_INVALIDDATA;
             goto fail;
         }
     }
@@ -108,10 +110,10 @@ static const enum AVCodecID codec_ids[] = {
 };
 
 #define OFFSET(x) offsetof(HapqaExtractContext, x)
-#define FLAGS     AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_BSF_PARAM)
 static const AVOption options[] = {
-    { "texture", "texture to keep", OFFSET(texture), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS,  "texture" },
-        { "color", "keep HapQ texture", 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "texture" },
+    { "texture", "texture to keep", OFFSET(texture), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "texture" },
+        { "color", "keep HapQ texture",         0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "texture" },
         { "alpha", "keep HapAlphaOnly texture", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "texture" },
     { NULL },
 };
@@ -120,7 +122,7 @@ static const AVClass hapqa_extract_class = {
     .class_name = "hapqa_extract_bsf",
     .item_name  = av_default_item_name,
     .option     = options,
-    .version    = LIBAVUTIL_VERSION_MAJOR,
+    .version    = LIBAVUTIL_VERSION_INT,
 };
 
 const AVBitStreamFilter ff_hapqa_extract_bsf = {