All pastes #801769 Raw Edit

Someone

public text v1 · immutable
#801769 ·published 2007-11-29 16:04 UTC
rendered paste body
Index: programs/mythbackend/scheduler.cpp
===================================================================
--- programs/mythbackend/scheduler.cpp  (revision 14987)
+++ programs/mythbackend/scheduler.cpp  (working copy)
@@ -1503,7 +1503,7 @@
                     nexttv->StartRecording(nextRecording);

                 nextRecording->AddHistory(false);
-                if (fsID > -1 && expirer)
+                if (expirer)
                 {
                     // activate auto expirer
                     expirer->Update(nextRecording->cardid, fsID, true);
@@ -2819,7 +2819,7 @@
     pginfo->cardid       = cardid;

     int fsID = FillRecordingDir(pginfo, reclist);
-    if (fsID > -1 && expirer)
+    if (expirer)
     {
         // update auto expirer
         expirer->Update(cardid, fsID, true);
Index: programs/mythbackend/autoexpire.cpp
===================================================================
--- programs/mythbackend/autoexpire.cpp (revision 14987)
+++ programs/mythbackend/autoexpire.cpp (working copy)
@@ -159,10 +159,14 @@
         if (fsMap.contains(fsit->fsID))
             continue;

-        fsMap[fsit->fsID] = 1;
-
+        fsMap[fsit->fsID] = 0;
         size_t thisKBperMin = 0;

+        // append unkown recordings to all fsIDs
+        vector<int>::iterator unknownfs_it = fsEncoderMap[-1].begin();
+        for (; unknownfs_it != fsEncoderMap[-1].end(); ++encit)
+            fsEncoderMap[fsit->fsID].push_back(*unknownfs_it);
+
         if (fsEncoderMap.contains(fsit->fsID))
         {
             VERBOSE(VB_FILE, QString(
@@ -988,14 +992,15 @@
         expirer->instance_cond.wait(&expirer->instance_lock);
     expirer->update_pending = true;

-    if (fsID > -1)
-    {
-        VERBOSE(VB_FILE, LOC
-                + QString("Cardid %1: is starting a recording on fsID %2 soon.")
-                .arg(encoder).arg(fsID));
-        expirer->used_encoders[encoder] = fsID;
-    }
+    QString msg = QString("Cardid %1: is starting a recording on").arg(encoder)
+    if (fsID == -1)
+        msg.append(" an unknown fsID soon.");
+    else
+        msg.appen(QString(" fsID %2 soon.").arg(fsID));

+    VERBOSE(VB_FILE, LOC + msg);
+    expirer->used_encoders[encoder] = fsID;
+
     expirer->instance_lock.unlock();

     // do it..