[mythtv] patch - just notify about commercials, don't autoskip

Kirby Vandivort kvandivo at ks.uiuc.edu
Fri Nov 7 00:55:23 EST 2003


I've been running this patch on my system for a week or so now.  Basically,
it gives you the option to not actually skip commercials, but just tell
you that it thinks there is one.  At the start of each commercial sequence,
it gives the number of seconds that it thinks the commercial is, but don't
actually skip.  You can then hit 'z' to jump to the end of the commercial
sequence if the numbers seem reasonable to you.

The setting page switched from just being a checkbox to actually being
a combo box where you can choose no, notify, or yes.

There is one little bug in it that I haven't been able to figure out.
It's a relatively minor bug, and I have lived with it for a week now
without killing myself (the pros definitely outweigh the con) so i
thought i would throw this out there.  On the frame where it thinks the
commercial is at a blank frame is shown.  Just one frame, it appears,
and you almost don't even notice it, but it is there.

Anyway, the patch is small.  Enjoy.

-- 

Kirby Vandivort                      Theoretical and 
Senior Research Programmer            Computational Biophysics 
Email: kvandivo at ks.uiuc.edu          3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/    University of Illinois
Phone: (217) 244-5711                405 N. Mathews Ave
Fax  : (217) 244-6078                Urbana, IL  61801, USA
-------------- next part --------------
Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/NuppelVideoPlayer.cpp,v
retrieving revision 1.290
diff -b -u -2 -r1.290 NuppelVideoPlayer.cpp
--- libs/libmythtv/NuppelVideoPlayer.cpp	5 Nov 2003 03:53:03 -0000	1.290
+++ libs/libmythtv/NuppelVideoPlayer.cpp	7 Nov 2003 05:40:06 -0000
@@ -3460,4 +3460,5 @@
 void NuppelVideoPlayer::AutoCommercialSkip(void)
 {
+
     if (hascommbreaktable)
     {
@@ -3468,4 +3469,5 @@
             return;
 
+
         if ((commBreakIter.data() == MARK_COMM_START) && 
             (framesPlayed >= commBreakIter.key()))
@@ -3482,9 +3484,13 @@
             else
             {
+
+	    if (autocommercialskip == 2)
+            {
                 if (osd)
                 {
                     int skipped_seconds = (int)((commBreakIter.key() -
                             framesPlayed) / video_frame_rate);
-                    QString comm_msg = QString(QObject::tr("Skip %1 seconds"))
+                    QString comm_msg = QString(QObject::tr(
+                                      "Commercial: %1 seconds")) 
                                       .arg(skipped_seconds);
                     QString desc;
@@ -3492,8 +3498,24 @@
                     osd->StartPause(spos, false, comm_msg, desc, 1);
                 }
-
+            }
+	    else
+	    {
+                if (osd)
+                {
+                    int skipped_seconds = (int)((commBreakIter.key() -
+                            framesPlayed) / video_frame_rate);
+                    QString comm_msg = QString(QObject::tr(
+			          "Skip %1 seconds")) .arg(skipped_seconds);
+                    QString desc;
+                    int spos = calcSliderPos(skipped_seconds, desc);
+                    osd->StartPause(spos, false, comm_msg, desc, 1);
+                }
                 JumpToFrame(commBreakIter.key());
             }
 
+
+
+            }
+
             GetFrame(1, true);
 
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.108
diff -b -u -2 -r1.108 globalsettings.cpp
--- programs/mythfrontend/globalsettings.cpp	1 Nov 2003 18:08:35 -0000	1.108
+++ programs/mythfrontend/globalsettings.cpp	7 Nov 2003 05:40:28 -0000
@@ -228,13 +228,17 @@
 };
 
-class AutoCommercialSkip: public CheckBoxSetting, public GlobalSetting {
+class AutoCommercialSkip: public ComboBoxSetting, public GlobalSetting {
 public:
     AutoCommercialSkip():
         GlobalSetting("AutoCommercialSkip") {
-        setLabel(QObject::tr("Automatically Skip Commercials"));
-        setValue(false);
+        setLabel(QObject::tr("Commercial Detected Action"));
+        addSelection(QObject::tr("Do nothing"), "0");
+        addSelection(QObject::tr("Automatically Skip"), "1");
+        addSelection(QObject::tr("Notify, but do not skip"), "2");
         setHelpText(QObject::tr("Automatically skip commercial breaks that "
                     "have been flagged during Automatic Commercial Flagging "
-                    "or by the mythcommflag program."));
+                    "or by the mythcommflag program, or just notify that a "
+		    "commercial has been detected."));
+
     };
 };


More information about the mythtv-dev mailing list