I could have sworn this was working way back when I initially
submitted it (I remember this "find once" case giving me problems back
then). It's possible that things were subtly busted between the time
of initial submission and eventual commit (lots of things were
changing).

The bug is that "find once" scheduled recordings do not get
auto-transcoded, despite correct recording profile and recording
schedule configuration. Auto-transcoding works correctly for any kind
of non-find-once recurring schedule.

The attached patch works for me, and I think it does make things a
little more robust than they are now.

Currently, the Recording Profile auto-transcode configuration is
stored in "autoTranscode", and the recording schedule GetAutoRunJobs
information is queried at the very last minute in
TVRec::TeardownRecorder.

This patch consolidates all the "autoTranscode" computations into the
former place, factoring in both Recording Profile and recording
schedule information.

My hand-waving explanation is that I believe the problem with "find
once" schedules is that by the time TVRec::TeardownRecorder is
reached, we've somehow lost the recording schedule information (which
contains the auto-transcode configuration), so that we revert back to
default values when a new data structure is constructed. The
justification for this hypothesis is that some debugging VERBOSE calls
reveal that curRecording->GetAutoRunJobs() in the currently-patched
location returns "3" (COMMFLAG | TRANSCODE), but
prevRecording->GetAutoRunJobs() in the TeardownRecorder location only
returns "2" (COMMFLAG) [for one-time scheduled recordings].

--Rob
Index: libs/libmythtv/tv_rec.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/tv_rec.cpp,v
retrieving revision 1.193
diff -u -r1.193 tv_rec.cpp
--- libs/libmythtv/tv_rec.cpp   6 Jun 2005 14:43:41 -0000       1.193
+++ libs/libmythtv/tv_rec.cpp   21 Jun 2005 03:18:24 -0000
@@ -635,11 +635,16 @@
         QString msg = QString("Using profile '%1' to record").arg(profileName);
         VERBOSE(VB_RECORD, msg);
 
-        // Determine whether to automatically run the transcoder or not
+        // Transcode iff recording profile AND recording schedule (if it
+        // exists) have set auto-transcode. If there is no recording schedule
+        // (e.g., "Live TV"), then recording profile auto-transcode setting is
+        // sufficient.
         Setting *profileAutoTranscode = profile.byName("autotranscode");
         autoTranscode = (profileAutoTranscode &&
-                         profileAutoTranscode->getValue().toInt() != 0) ?
-                         true : false;
+                profileAutoTranscode->getValue().toInt() != 0 &&
+                (!curRecording ||
+                 (curRecording->GetAutoRunJobs() & JOB_TRANSCODE) != 0)) ?
+            true : false;
 
         bool error = false;
 
@@ -852,8 +857,8 @@
  *
  *   A "RECORDING_LIST_CHANGE" message is dispatched.
  *
- *   Finally if there was a recording and it was not deleted
- *   commercial flagging and user jobs are scheduled.
+ *   Finally, if there was a recording and it was not deleted,
+ *   schedule post-processing jobs.
  *
  *  \param killFile if true the recorded file is deleted.
  */
@@ -930,9 +935,8 @@
                  ((!autoTranscode) || (autoTranscode && !transcodeFirst))))
                 jobTypes = jobTypes & (~JOB_COMMFLAG);
 
-            // Only auto-transcode if recording profile allows it.
-            if (!autoTranscode)
-                jobTypes &= ~JOB_TRANSCODE;
+            if (autoTranscode)
+                jobTypes |= JOB_TRANSCODE;
 
             if (jobTypes)
             {

Attachment: signature.asc
Description: Digital signature

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to