diff mbox series

[FFmpeg-devel,v5,3/4] avcodec: enable usage of AV_EF_EXPLODE for subtitle encoders

Message ID 20210222131914.21335-4-jeebjp@gmail.com
State New
Headers show
Series Initial implementation of TTML encoding/muxing
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Jan Ekström Feb. 22, 2021, 1:19 p.m. UTC
From: Jan Ekström <jan.ekstrom@24i.com>

As currently it is the responsibility of the following subtitle
encoder to validate the correctness of the incoming ASS dialog line.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
---
 libavcodec/avcodec.h       | 5 ++++-
 libavcodec/options_table.h | 4 ++--
 libavcodec/version.h       | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

Comments

Jan Ekström Feb. 28, 2021, 10:15 p.m. UTC | #1
On Mon, Feb 22, 2021 at 3:19 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> From: Jan Ekström <jan.ekstrom@24i.com>
>
> As currently it is the responsibility of the following subtitle
> encoder to validate the correctness of the incoming ASS dialog line.
>
> Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>

Requesting comments on this bit of the change set, since apparently
the actual implementation bits have been reviewed.

This way of doing it was recommended by Anton, and as noted in the
opening mail for the patch set I am open to just an AVOption if
someone feels like this is a bad idea.

Jan
diff mbox series

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7dbf083a24..9fffe8bcec 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1634,7 +1634,10 @@  typedef struct AVCodecContext {
 
     /**
      * Error recognition; may misdetect some more or less valid parts as errors.
-     * - encoding: unused
+     * - encoding: Set by user. Currently only AV_EF_EXPLODE is valid, and only
+     *             for subtitle encoders, since checking the validity of an ASS
+     *             dialog line is currently the responsibility of the following
+     *             encoder.
      * - decoding: Set by user.
      */
     int err_recognition;
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index ded9de4d67..f159a4b410 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -140,11 +140,11 @@  static const AVOption avcodec_options[] = {
 {"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, A|V|D|E, "strict"},
 {"experimental", "allow non-standardized experimental things", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, A|V|D|E, "strict"},
 {"b_qoffset", "QP offset between P- and B-frames", OFFSET(b_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E},
-{"err_detect", "set error detection flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
+{"err_detect", "set error detection flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, INT_MIN, INT_MAX, A|V|D|E, "err_detect"},
 {"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
 {"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
 {"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
-{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
+{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, A|V|D|E, "err_detect"},
 {"ignore_err", "ignore errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_IGNORE_ERR }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
 {"careful",    "consider things that violate the spec, are fast to check and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
 {"compliant",  "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT | AV_EF_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "err_detect"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 9325da1028..85fbbfe766 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@ 
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR 125
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \