Permalink
Browse files

Carry over [13171] from trunk. Ignores commercial skips at the end of…

… the

recording so we don't skip directly to the end.

References #3275.



git-svn-id: http://svn.mythtv.org/svn/branches/release-0-20-fixes@13330 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information...
1 parent ea11fb3 commit 2879ba1c1d3e264839a05cc1232246e932e213a0 @cpinkham cpinkham committed Apr 25, 2007
Showing with 13 additions and 14 deletions.
  1. +13 −14 mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
@@ -5480,30 +5480,26 @@ void NuppelVideoPlayer::AutoCommercialSkip(void)
++commBreakIter;
if (commBreakIter == commBreakMap.end())
{
- commBreakMapLock.unlock();
VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), at "
"end of commercial break list, will not skip.");
- return;
}
-
- if (commBreakIter.data() == MARK_COMM_START)
+ else if (commBreakIter.data() == MARK_COMM_START)
{
- commBreakMapLock.unlock();
VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), new "
"commBreakIter mark is another start, will not skip.");
- return;
}
-
- VERBOSE(VB_COMMFLAG, LOC + QString("AutoCommercialSkip(), new "
- "commBreakIter frame %1").arg(commBreakIter.key()));
-
- if (commBreakIter.key() == totalFrames)
+ else if ((totalFrames) &&
+ ((commBreakIter.key() + (10 * video_frame_rate)) >
+ totalFrames))
{
- VERBOSE(VB_IMPORTANT, LOC + "Skipping commercial to end of file");
- eof = true;
+ VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), skipping "
+ "would take us to the end of the file, will not skip.");
}
else
{
+ VERBOSE(VB_COMMFLAG, LOC + QString("AutoCommercialSkip(), new "
+ "commBreakIter frame %1").arg(commBreakIter.key()));
+
if (osd)
{
QString comm_msg;
@@ -5668,7 +5664,10 @@ bool NuppelVideoPlayer::DoSkipCommercials(int direction)
{
commBreakIter++;
- if (commBreakIter == commBreakMap.end())
+ if ((commBreakIter == commBreakMap.end()) ||
+ ((totalFrames) &&
+ ((commBreakIter.key() + (10 * video_frame_rate)) >
+ totalFrames)))
{
if (osd)
{

0 comments on commit 2879ba1

Please sign in to comment.