Author: duncan
Date: Fri Sep 29 11:11:49 2006
New Revision: 8258

Modified:
   branches/rel-1-5/freevo/freevo_config.py
   branches/rel-1-5/freevo/src/helpers/recordserver.py
   branches/rel-1-5/freevo/src/tv/ivtv_xine_tv.py

Log:
[ 1567502 ] Separate pre- and post-recording padding
Patch applied.


Modified: branches/rel-1-5/freevo/freevo_config.py
==============================================================================
--- branches/rel-1-5/freevo/freevo_config.py    (original)
+++ branches/rel-1-5/freevo/freevo_config.py    Fri Sep 29 11:11:49 2006
@@ -226,7 +226,11 @@
      '''Add two variables for mplayer post processing: MPLAYER_VF_INTERLACED 
and
      MPLAYER_VF_PROGRESSIVE''' ),
     (5.16,
-     '''Added TV_RECORDFILE_OKLETTERS so that the recorded file names are 
ok''' ),
+     '''Added XINE_TV_VO_DEV, XINE_TV_AO_DEV, and XINE_TV_TIMESHIFT_FILEMASK 
for the
+        new tv.ivtv_xine_tv plugin (the latter should be e.g. "/tmp/xine-buf-" 
and point
+        to a place with enough free diskspace (several gigabytes).
+        Added TV_RECORD_PADDING_PRE/POST for separately setting 
TV_RECORD_PADDING
+        Added TV_RECORDFILE_OKLETTERS for characters allowed in recording 
filenames.''' ),
 ]
 
 
@@ -1166,6 +1170,10 @@
 if CONF.fbxine:
     plugin.activate('audio.xine')
 
+# default to XINE_VO/AO_DEV:
+XINE_TV_VO_DEV = None
+XINE_TV_AO_DEV = None
+XINE_TV_TIMESHIFT_FILEMASK = "/you must set XINE_TV_TIMESHIFT_FILEMASK in your 
local_conf.py"
 
 # ======================================================================
 # Freevo TV settings:
@@ -1252,6 +1260,8 @@
 # This must be a value in seconds although at the moment only has
 # the percision of one minute.
 TV_RECORD_PADDING = 0 * 60
+TV_REVORD_PADDING_PRE = None
+TV_REVORD_PADDING_POST = None
 
 if os.uname()[0] == 'FreeBSD':
   # FreeBSD's bsdbt848 TV driver doesn't support audio settings?

Modified: branches/rel-1-5/freevo/src/helpers/recordserver.py
==============================================================================
--- branches/rel-1-5/freevo/src/helpers/recordserver.py (original)
+++ branches/rel-1-5/freevo/src/helpers/recordserver.py Fri Sep 29 11:11:49 2006
@@ -140,6 +140,10 @@
 # XXX: In the future we should have one lock per VideoGroup.
 tv_lock_file = config.FREEVO_CACHEDIR + '/record'
 
+if config.TV_RECORD_PADDING_PRE == None:
+    config.TV_RECORD_PADDING_PRE = config.TV_RECORD_PADDING
+if config.TV_RECORD_PADDING_POST == None:
+    config.TV_RECORD_PADDING_POST = config.TV_RECORD_PADDING
 
 def print_plugin_warning():
     print '*************************************************'
@@ -391,7 +395,6 @@
         rec_prog = None
         cleaned = None
         delay_recording = FALSE
-        total_padding = 0
 
         sr = self.getScheduledRecordings()
         progs = sr.getProgramList()
@@ -415,14 +418,14 @@
             except:
                 recording = FALSE
 
-            if (prog.start - config.TV_RECORD_PADDING) <= now \
-                   and (prog.stop + config.TV_RECORD_PADDING) >= now \
+            if (prog.start - config.TV_RECORD_PADDING_PRE) <= now \
+                   and (prog.stop + config.TV_RECORD_PADDING_POST) >= now \
                    and recording == FALSE:
                 # just add to the 'we want to record this' list
                 # then end the loop, and figure out which has priority,
                 # remember to take into account the full length of the shows
                 # and how much they overlap, or chop one short
-                duration = int((prog.stop + config.TV_RECORD_PADDING ) - now - 
10)
+                duration = int((prog.stop + config.TV_RECORD_PADDING_POST ) - 
now - 10)
                 if duration < 10:
                     return 
 
@@ -435,7 +438,7 @@
                         # has a higher priority.
                         if self.isProgAFavorite(prog)[0] and \
                            not self.isProgAFavorite(currently_recording)[0] 
and \
-                           prog.stop + config.TV_RECORD_PADDING > now:
+                           prog.stop + config.TV_RECORD_PADDING_POST > now:
                             _debug_('ignore %s' % String(prog))
                             continue
                         sr.removeProgram(currently_recording, 
@@ -451,9 +454,10 @@
                             # Therefore we have overlapping paddings but not
                             # real stop / start times.
                             overlap = (currently_recording.stop + \
-                                       config.TV_RECORD_PADDING) - \
-                                      (prog.start - config.TV_RECORD_PADDING)
-                            if overlap <= (config.TV_RECORD_PADDING/2):
+                                       config.TV_RECORD_PADDING_POST) - \
+                                      (prog.start - 
config.TV_RECORD_PADDING_PRE)
+                            if overlap <= ((config.TV_RECORD_PADDING_PRE +
+                                           config.TV_RECORD_PADDING_POST)/4):
                                 sr.removeProgram(currently_recording, 
                                                  
tv_util.getKey(currently_recording))
                                 plugin.getbyname('RECORD').Stop()
@@ -477,7 +481,7 @@
 
         for prog in progs.values():
             # If the program is over remove the entry.
-            if ( prog.stop + config.TV_RECORD_PADDING) < now:
+            if ( prog.stop + config.TV_RECORD_PADDING_POST) < now:
                 _debug_('found a program to clean')
                 cleaned = TRUE
                 del progs[tv_util.getKey(prog)]
@@ -622,7 +626,7 @@
     
         for fav in favs.values():
     
-            if prog.title.lower() == fav.title.lower():    
+            if prog.title.lower().find(fav.title.lower()) >= 0:
                 if fav.channel == 
tv_util.get_chan_displayname(prog.channel_id) \
                    or fav.channel == 'ANY':
                     if Unicode(fav.dow) == Unicode(dow) or Unicode(fav.dow) == 
u'ANY':
@@ -705,33 +709,18 @@
             # if prog.start <= last and favorite:
             (isFav, favorite) = self.isProgAFavorite(prog, favs)
             if prog.start <= last and isFav:
-                # do not yet remove programs that are currently being recorded:
-                try:
-                    rec_now = prog.isRecording
-                except:
-                    rec_now = False
-
-                if rec_now:
-                    _debug_("not removing currently recorded favorite")
-                else:
+                # do not yet remove programs currently being recorded:
+                isRec = hasattr(prog, "isRecording") and prog.isRecording
+                if not isRec:
                     self.removeScheduledRecording(prog)
     
         for ch in guide.chan_list:
             for prog in ch.programs:
                 (isFav, favorite) = self.isProgAFavorite(prog, favs)
-                if isFav:
-                    # do not schedule favorites that are currently being 
recorded:
-                    try:
-                        rec_now = prog.isRecording
-                    except:
-                        rec_now = False
-
-                    if rec_now:
-                        _debug_("not scheduling currently recorded favorite")
-                    else:
-                        prog.isFavorite = favorite
-                        self.scheduleRecording(prog)
-
+                isRec = hasattr(prog, "isRecording") and prog.isRecording
+                if isFav and not isRec:
+                    prog.isFavorite = favorite
+                    self.scheduleRecording(prog)
 
         return (TRUE, 'favorites schedule updated')
     

Modified: branches/rel-1-5/freevo/src/tv/ivtv_xine_tv.py
==============================================================================
--- branches/rel-1-5/freevo/src/tv/ivtv_xine_tv.py      (original)
+++ branches/rel-1-5/freevo/src/tv/ivtv_xine_tv.py      Fri Sep 29 11:11:49 2006
@@ -24,6 +24,11 @@
 TRUE = 1
 FALSE = 0
 
+if not config.XINE_TV_VO_DEV:
+       config.XINE_TV_VO_DEV = config.XINE_VO_DEV
+if not config.XINE_TV_AO_DEV:
+       config.XINE_TV_AO_DEV = config.XINE_AO_DEV
+
 class PluginInterface(plugin.Plugin):
     """
     Plugin to watch tv with xine.
@@ -64,7 +69,7 @@
 
         # Suppress annoying audio clicks
         time.sleep(0.4)
-        self.mixer.start()
+        self.mixer.start(mode)
 
         _debug_('%s: started %s app' % (time.time(), self.mode))
 
@@ -310,13 +315,13 @@
                 self.volume = self.mixer.getPcmVolume()
                 self.mixer.setPcmVolume(0)
 
-    def start(self):
+    def start(self, mode):
 
 
         if (self.mixer != None):
 
             # XXX Hm.. This is hardcoded and very unflexible.
-            if self.mode == 'vcr':
+            if mode == 'vcr':
                 self.mixer.setMicVolume(config.VCR_IN_VOLUME)
 
             else:

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to