0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

demux_lavf: check for NAN rotation angles

Yep, the FFmpeg API can return this.
This commit is contained in:
wm4 2015-06-30 19:35:19 +02:00
parent aa42b6ba35
commit c0aba8e25a

View File

@ -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");