Skip to content

Commit

Permalink
Rework RecorderBase::AspectChange() so it can't cause divide by zero.
Browse files Browse the repository at this point in the history
Conflicts:

	mythtv/libs/libmythtv/recorderbase.cpp
  • Loading branch information
daniel-kristjansson committed May 18, 2012
1 parent 9217878 commit acc4cd4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythtv/libs/libmythtv/recorderbase.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit acc4cd4

Please sign in to comment.