This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 7c2853dfc1 avformat/demux: restore container color fields individually
7c2853dfc1 is described below
commit 7c2853dfc1d328b0dd98b7915e589eb1e8dc15a1
Author: adorn <[email protected]>
AuthorDate: Mon Jun 29 14:50:10 2026 +0200
Commit: James Almer <[email protected]>
CommitDate: Mon Aug 10 21:59:55 2026 +0000
avformat/demux: restore container color fields individually
Fixes issue #23717
The upstream change 9b709532d5 ("avformat/demux: don't overwrite
container level color information if set") restores color_primaries,
color_trc and color_space from the container as an all-or-nothing
group: as soon as one of the three is signaled at container level,
all three are taken from the container.
MXF files written by some devices only carry the TransferCharacteristic
UL (MXF local tag 0x3210) but no ColorPrimaries (0x3219) or
CodingEquations (0x321a). For an H.264 essence whose VUI correctly
signals bt709 for all three, the grouped logic overwrites
color_primaries and color_space with the container's UNSPECIFIED
values, so ffprobe reports:
color_space=unknown / color_primaries=unknown / color_transfer=bt709
instead of the bitstream's bt709/bt709/bt709.
Restore each of the three fields only when it is actually set at the
container level. This keeps container priority where a value is
signaled and falls back to the bitstream (decoder/parser) value
otherwise.
---
libavformat/demux.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libavformat/demux.c b/libavformat/demux.c
index 193fd17739..2375b277e4 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -2587,13 +2587,12 @@ static int parameters_from_context(AVFormatContext *ic,
AVCodecParameters *par,
*/
if (par_tmp->color_range != AVCOL_RANGE_UNSPECIFIED)
par->color_range = par_tmp->color_range;
- if (par_tmp->color_primaries != AVCOL_PRI_UNSPECIFIED ||
- par_tmp->color_trc != AVCOL_TRC_UNSPECIFIED ||
- par_tmp->color_space != AVCOL_SPC_UNSPECIFIED) {
+ if (par_tmp->color_primaries != AVCOL_PRI_UNSPECIFIED)
par->color_primaries = par_tmp->color_primaries;
+ if (par_tmp->color_trc != AVCOL_TRC_UNSPECIFIED)
par->color_trc = par_tmp->color_trc;
+ if (par_tmp->color_space != AVCOL_SPC_UNSPECIFIED)
par->color_space = par_tmp->color_space;
- }
if (par_tmp->chroma_location != AVCHROMA_LOC_UNSPECIFIED)
par->chroma_location = par_tmp->chroma_location;
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]