avformat/matroskaenc: Remove pointless casts

by using a const void * pointer as an intermediate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-05-21 23:57:19 +02:00
parent 68dd1e6a57
commit 72baae1395
1 changed files with 3 additions and 5 deletions

View File

@ -836,7 +836,7 @@ static void mkv_write_video_color(AVIOContext *pb, const AVStream *st,
uint8_t colour[(2 + 1 + 8) * 18 + (2 + 1) + 1]; uint8_t colour[(2 + 1 + 8) * 18 + (2 + 1) + 1];
AVIOContext buf, *dyn_cp = &buf; AVIOContext buf, *dyn_cp = &buf;
int colorinfo_size; int colorinfo_size;
const uint8_t *side_data; const void *side_data;
ffio_init_context(dyn_cp, colour, sizeof(colour), 1, NULL, NULL, NULL, NULL); ffio_init_context(dyn_cp, colour, sizeof(colour), 1, NULL, NULL, NULL, NULL);
@ -869,8 +869,7 @@ static void mkv_write_video_color(AVIOContext *pb, const AVStream *st,
side_data = av_stream_get_side_data(st, AV_PKT_DATA_CONTENT_LIGHT_LEVEL, side_data = av_stream_get_side_data(st, AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
NULL); NULL);
if (side_data) { if (side_data) {
const AVContentLightMetadata *metadata = const AVContentLightMetadata *metadata = side_data;
(const AVContentLightMetadata*)side_data;
put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORMAXCLL, metadata->MaxCLL); put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORMAXCLL, metadata->MaxCLL);
put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORMAXFALL, metadata->MaxFALL); put_ebml_uint(dyn_cp, MATROSKA_ID_VIDEOCOLORMAXFALL, metadata->MaxFALL);
} }
@ -880,8 +879,7 @@ static void mkv_write_video_color(AVIOContext *pb, const AVStream *st,
if (side_data) { if (side_data) {
ebml_master meta_element = start_ebml_master( ebml_master meta_element = start_ebml_master(
dyn_cp, MATROSKA_ID_VIDEOCOLORMASTERINGMETA, 10 * (2 + 1 + 8)); dyn_cp, MATROSKA_ID_VIDEOCOLORMASTERINGMETA, 10 * (2 + 1 + 8));
const AVMasteringDisplayMetadata *metadata = const AVMasteringDisplayMetadata *metadata = side_data;
(const AVMasteringDisplayMetadata*)side_data;
if (metadata->has_primaries) { if (metadata->has_primaries) {
put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_RX, put_ebml_float(dyn_cp, MATROSKA_ID_VIDEOCOLOR_RX,
av_q2d(metadata->display_primaries[0][0])); av_q2d(metadata->display_primaries[0][0]));