[FFmpeg-devel] [PATCH] Fix incorrect extraction of Origin (PR #20656)

2025-10-06 Thread anders-mjoll via ffmpeg-devel
PR #20656 opened by anders-mjoll
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20656
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20656.patch

The code that attempted to extract origin (4B.02) was put in the wrong
metadata handler and was also read as the wrong integer type. According
ST 377-1 Origin is of type "Position" (Int64) in the Timeline Track, not
a 8 bit unsigned integer in the Sequence.


>From a958b6b8ef9e102b4846fd52882a9983600894ee Mon Sep 17 00:00:00 2001
From: Anders Rein 
Date: Mon, 6 Oct 2025 16:23:45 +0200
Subject: [PATCH] Fix incorrect extraction of Origin

The code that attempted to extract origin (4B.02) was put in the wrong
metadata handler and was also read as the wrong integer type. According
ST 377-1 Origin is of type "Position" (Int64) in the Timeline Track, not
a 8 bit unsigned integer in the Sequence.
---
 libavformat/mxfdec.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index dc5dff651a..59b9b43a22 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -145,7 +145,6 @@ typedef struct MXFSequence {
 UID *structural_components_refs;
 int structural_components_count;
 int64_t duration;
-uint8_t origin;
 } MXFSequence;
 
 typedef struct MXFTimecodeComponent {
@@ -189,6 +188,7 @@ typedef struct {
 int body_sid;
 MXFWrappingScheme wrapping;
 int edit_units_per_packet; /* how many edit units to read at a time (PCM, 
ClipWrapped) */
+int64_t origin;
 } MXFTrack;
 
 typedef struct MXFDescriptor {
@@ -1155,6 +1155,9 @@ static int mxf_read_track(void *arg, AVIOContext *pb, int 
tag, int size, UID uid
 track->edit_rate.num = avio_rb32(pb);
 track->edit_rate.den = avio_rb32(pb);
 break;
+case 0x4b02:
+track->origin = avio_rb64(pb);
+break;
 case 0x4803:
 avio_read(pb, track->sequence_ref, 16);
 break;
@@ -1172,9 +1175,6 @@ static int mxf_read_sequence(void *arg, AVIOContext *pb, 
int tag, int size, UID
 case 0x0201:
 avio_read(pb, sequence->data_definition_ul, 16);
 break;
-case 0x4b02:
-sequence->origin = avio_r8(pb);
-break;
 case 0x1001:
 return mxf_read_strong_ref_array(pb, 
&sequence->structural_components_refs,
  
&sequence->structural_components_count);
@@ -3025,11 +3025,11 @@ static int mxf_parse_structural_metadata(MXFContext 
*mxf)
 }
 }
 sti->need_parsing = AVSTREAM_PARSE_HEADERS;
-if (material_track->sequence->origin) {
-av_dict_set_int(&st->metadata, "material_track_origin", 
material_track->sequence->origin, 0);
+if (material_track->origin) {
+av_dict_set_int(&st->metadata, "material_track_origin", 
material_track->origin, 0);
 }
-if (source_track->sequence->origin) {
-av_dict_set_int(&st->metadata, "source_track_origin", 
source_track->sequence->origin, 0);
+if (source_track->origin) {
+av_dict_set_int(&st->metadata, "source_track_origin", 
source_track->origin, 0);
 }
 if (descriptor->aspect_ratio.num && descriptor->aspect_ratio.den)
 sti->display_aspect_ratio = descriptor->aspect_ratio;
-- 
2.49.1

___
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]


[FFmpeg-devel] [PATCH] Fixed broken aselect filter (PR #20949)

2025-11-17 Thread anders-mjoll via ffmpeg-devel
PR #20949 opened by anders-mjoll
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20949
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20949.patch

During migration to the activation filter API the aselect filter was
accidentally turned into a no-op filter.


>From dd7f99e5b17acde5de927587259d7b2d52126ab6 Mon Sep 17 00:00:00 2001
From: Anders Rein 
Date: Mon, 17 Nov 2025 23:52:49 +0100
Subject: [PATCH] Fixed broken aselect filter

During migration to the activation filter API the aselect filter was
accidentally turned into a no-op filter.
---
 libavfilter/f_select.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 46208a7b76..3781e50814 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -504,6 +504,7 @@ const FFFilter ff_af_aselect = {
 .p.flags   = AVFILTER_FLAG_DYNAMIC_OUTPUTS,
 .init= aselect_init,
 .uninit  = uninit,
+.activate  = activate,
 .priv_size   = sizeof(SelectContext),
 FILTER_INPUTS(avfilter_af_aselect_inputs),
 };
-- 
2.49.1

___
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]