Permalink
Browse files

Rework RecorderBase::AspectChange() so it can't cause divide by zero.

Conflicts:

	mythtv/libs/libmythtv/recorderbase.cpp
  • Loading branch information...
daniel-kristjansson committed May 18, 2012
1 parent 9217878 commit acc4cd4bc2cf4f320b56d8ecdfaf737af047bbfe
Showing with 4 additions and 3 deletions.
  1. +4 −3 mythtv/libs/libmythtv/recorderbase.cpp
@@ -444,13 +444,14 @@ void RecorderBase::AspectChange(uint aspect, long long frame)
{
MarkTypes mark = MARK_ASPECT_4_3;
uint customAspect = 0;
- if ((aspect == ASPECT_1_1 && m_videoHeight) || (aspect >= ASPECT_CUSTOM))
+ if (aspect == ASPECT_1_1 || aspect >= ASPECT_CUSTOM)
{
- mark = MARK_ASPECT_CUSTOM;
if (aspect > 0x0F)
customAspect = aspect;
- else
+ else if (m_videoWidth && m_videoHeight)
customAspect = m_videoWidth * 1000000 / m_videoHeight;
+
+ mark = (customAspect) ? MARK_ASPECT_CUSTOM : mark;
}
if (aspect == ASPECT_4_3)
mark = MARK_ASPECT_4_3;

0 comments on commit acc4cd4

Please sign in to comment.