[FFmpeg-devel] [PATCH 4/9] avformat/avisynth: add read_frameprop_field_order option
Stephen Hutchinson
qyot27 at gmail.com
Mon Aug 29 03:02:39 EEST 2022
Signed-off-by: Stephen Hutchinson <qyot27 at gmail.com>
---
libavformat/avisynth.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 5d726d70a5..c76b50421c 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -104,6 +104,7 @@ typedef struct AviSynthContext {
/* (de)activate reading frame properties */
int frameprops;
+ int frameprop_field_order;
int frameprop_sar;
/* Linked list pointers. */
@@ -525,21 +526,23 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
if(avs->frameprops) {
/* Field order */
- if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
- st->codecpar->field_order = AV_FIELD_UNKNOWN;
- } else {
- switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
- case 0:
- st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
- break;
- case 1:
- st->codecpar->field_order = AV_FIELD_BB;
- break;
- case 2:
- st->codecpar->field_order = AV_FIELD_TT;
- break;
- default:
+ if(avs->frameprop_field_order) {
+ if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
st->codecpar->field_order = AV_FIELD_UNKNOWN;
+ } else {
+ switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
+ case 0:
+ st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
+ break;
+ case 1:
+ st->codecpar->field_order = AV_FIELD_BB;
+ break;
+ case 2:
+ st->codecpar->field_order = AV_FIELD_TT;
+ break;
+ default:
+ st->codecpar->field_order = AV_FIELD_UNKNOWN;
+ }
}
}
@@ -1152,6 +1155,7 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index,
#define OFFSET(x) offsetof(AviSynthContext, x)
static const AVOption avisynth_options[] = {
{ "read_frameprops", "Read frame properties from script (AviSynth+ v3.7.1+).", OFFSET(frameprops), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "read_frameprop_field_order", "Read field order from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_field_order), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ NULL },
};
--
2.34.1
More information about the ffmpeg-devel
mailing list