diff options
author | wm4 <wm4@nowhere> | 2015-06-30 19:35:19 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-30 19:35:19 +0200 |
commit | c0aba8e25ae7dd93aa945d782771d897d49fbea7 (patch) | |
tree | d886ded0d2ea99ae2d3183fe64a926d0a4acdfef /demux | |
parent | aa42b6ba3503cba42a094445cd1bb47a88559d4c (diff) | |
download | mpv-c0aba8e25ae7dd93aa945d782771d897d49fbea7.tar.bz2 mpv-c0aba8e25ae7dd93aa945d782771d897d49fbea7.tar.xz |
demux_lavf: check for NAN rotation angles
Yep, the FFmpeg API can return this.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_lavf.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index db4c8edac9..a765ce8a44 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -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"); |