1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/mov: don't use sizeof(AVMasteringDisplayMetadata)

It's not part of the libavutil ABI.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2024-06-19 15:19:56 -03:00
parent 8a85d3fd39
commit a91f34aad8
2 changed files with 4 additions and 3 deletions

View File

@ -250,6 +250,7 @@ typedef struct MOVStreamContext {
AVSphericalMapping *spherical;
size_t spherical_size;
AVMasteringDisplayMetadata *mastering;
size_t mastering_size;
AVContentLightMetadata *coll;
size_t coll_size;
AVAmbientViewingEnvironment *ambient;

View File

@ -6138,7 +6138,7 @@ static int mov_read_smdm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_skip(pb, 3); /* flags */
sc->mastering = av_mastering_display_metadata_alloc();
sc->mastering = av_mastering_display_metadata_alloc_size(&sc->mastering_size);
if (!sc->mastering)
return AVERROR(ENOMEM);
@ -6181,7 +6181,7 @@ static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
}
sc->mastering = av_mastering_display_metadata_alloc();
sc->mastering = av_mastering_display_metadata_alloc_size(&sc->mastering_size);
if (!sc->mastering)
return AVERROR(ENOMEM);
@ -10043,7 +10043,7 @@ static int mov_read_header(AVFormatContext *s)
if (sc->mastering) {
if (!av_packet_side_data_add(&st->codecpar->coded_side_data, &st->codecpar->nb_coded_side_data,
AV_PKT_DATA_MASTERING_DISPLAY_METADATA,
(uint8_t *)sc->mastering, sizeof(*sc->mastering), 0))
(uint8_t *)sc->mastering, sc->mastering_size, 0))
return AVERROR(ENOMEM);
sc->mastering = NULL;