deps/media-playback: Fix metadata for hw_accel

av_hwframe_transfer_data doesn't seem to transfer metadata, so do it
manually.
master
jpark37 2022-06-15 10:47:19 -07:00 committed by Jim
parent 295386781f
commit 22fde5cdcd
1 changed files with 7 additions and 1 deletions

View File

@ -346,9 +346,15 @@ static int decode_packet(struct mp_decode *d, int *got_frame)
}
int err = av_hwframe_transfer_data(d->sw_frame, d->hw_frame, 0);
if (err != 0) {
if (err) {
ret = 0;
*got_frame = false;
} else {
d->sw_frame->color_range = d->hw_frame->color_range;
d->sw_frame->color_primaries =
d->hw_frame->color_primaries;
d->sw_frame->color_trc = d->hw_frame->color_trc;
d->sw_frame->colorspace = d->hw_frame->colorspace;
}
}
#endif