mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 12:17:12 +00:00
demux_lavf: check for NAN rotation angles
Yep, the FFmpeg API can return this.
This commit is contained in:
parent
aa42b6ba35
commit
c0aba8e25a
@ -575,9 +575,11 @@ static void handle_stream(demuxer_t *demuxer, int i)
|
||||
/ (float)(codec->height * codec->sample_aspect_ratio.den);
|
||||
|
||||
uint8_t *sd = av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL);
|
||||
if (sd)
|
||||
sh_video->rotate = -av_display_rotation_get((uint32_t *)sd);
|
||||
sh_video->rotate = ((sh_video->rotate % 360) + 360) % 360;
|
||||
if (sd) {
|
||||
double r = av_display_rotation_get((uint32_t *)sd);
|
||||
if (!isnan(r))
|
||||
sh_video->rotate = (((int)(-r) % 360) + 360) % 360;
|
||||
}
|
||||
|
||||
// This also applies to vfw-muxed mkv, but we can't detect these easily.
|
||||
sh_video->avi_dts = matches_avinputformat_name(priv, "avi");
|
||||
|
Loading…
Reference in New Issue
Block a user