From c0aba8e25ae7dd93aa945d782771d897d49fbea7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 30 Jun 2015 19:35:19 +0200 Subject: demux_lavf: check for NAN rotation angles Yep, the FFmpeg API can return this. --- demux/demux_lavf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'demux') 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"); -- cgit v1.2.3