[FFmpeg-devel] [PATCH] matroskadec: Adjust content light side data check
Vittorio Giovara
vittorio.giovara at gmail.com
Sun Jan 13 19:17:24 EET 2019
While in practice both fields are always initialized, this mimics
what other tools like ffms2, and x265 do more closely.
This work has been sponsored by Tyrell Corporation, for a compensation
of dozen of cents of US dollars.
---
libavformat/matroskadec.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 4ad99db7db..3ff3516c24 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1877,7 +1877,7 @@ static int mkv_parse_video_color(AVStream *st, const MatroskaTrack *track) {
avcodec_chroma_pos_to_enum((color->chroma_siting_horz - 1) << 7,
(color->chroma_siting_vert - 1) << 7);
}
- if (color->max_cll && color->max_fall) {
+ if (color->max_cll || color->max_fall) {
size_t size = 0;
int ret;
AVContentLightMetadata *metadata = av_content_light_metadata_alloc(&size);
@@ -1891,6 +1891,9 @@ static int mkv_parse_video_color(AVStream *st, const MatroskaTrack *track) {
}
metadata->MaxCLL = color->max_cll;
metadata->MaxFALL = color->max_fall;
+ av_log(NULL, AV_LOG_INFO, "Content Light Level Metadata, "
+ "MaxCLL=%d, MaxFALL=%d",
+ metadata->MaxCLL, metadata->MaxFALL);
}
if (has_mastering_primaries || has_mastering_luminance) {
@@ -3552,6 +3555,8 @@ static int matroska_read_seek(AVFormatContext *s, int stream_index,
AVStream *st = s->streams[stream_index];
int i, index, index_min;
+ flags ^= AVSEEK_FLAG_ANY;
+
/* Parse the CUES now since we need the index data to seek. */
if (matroska->cues_parsing_deferred > 0) {
matroska->cues_parsing_deferred = 0;
--
2.20.1
More information about the ffmpeg-devel
mailing list