From 88c029b2efbfd9ca58d0acb6e10049b9d3ce6c30 Mon Sep 17 00:00:00 2001
From: Lawrence Rust <lvr@softsystem.co.uk>
Date: Sun, 15 Jan 2012 18:30:41 +0100
Subject: [PATCH] mythtranscode: Avoid a floating point exception
When mythtranscode is run with a non default profile it can
throw a flating point exception during initialisation:
Program terminated with signal 8, Arithmetic exception.
422 if ((ydiff / display_video_rect.height()) < 0.05)
(gdb) bt
new_display_visible_rect=..., new_aspectoverride=kAspect_Off, new_adjustfill=kAdjustFill_AutoDetect_DefaultHalf)
at videooutwindow.cpp:484
winh=0, codec_id=kCodec_MPEG2, embedid=0) at videooutbase.cpp:419
winw=0, winh=0, codec_id=kCodec_MPEG2, embedid=0) at videoout_null.cpp:152
framecontrol=false, jobID=-1, fifodir=..., fifo_info=false, deleteMap=...) at transcode.cpp:716
This is caused by display_video_rect.height() being 0.
Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
---
mythtv/libs/libmythtv/videooutwindow.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/mythtv/libs/libmythtv/videooutwindow.cpp b/mythtv/libs/libmythtv/videooutwindow.cpp
index d103cac..d1de328 100644
|
a
|
b
|
void VideoOutWindow::ApplySnapToVideoRect(void)
|
| 418 | 418 | if (pip_state > kPIPOff) |
| 419 | 419 | return; |
| 420 | 420 | |
| | 421 | if (display_video_rect.height() == 0 || display_video_rect.width() == 0) |
| | 422 | return; |
| | 423 | |
| 421 | 424 | float ydiff = abs(display_video_rect.height() - video_rect.height()); |
| 422 | 425 | if ((ydiff / display_video_rect.height()) < 0.05) |
| 423 | 426 | { |