User:Zavex/patches

From MythTV Official Wiki
< User:Zavex
Revision as of 20:40, 31 May 2008 by Zavex (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ac3dec.patch check crc on ac3 audio to prevent high chirps from corrupt audio

--- ac3dec.c    2008-02-10 14:56:11.000000000 -0600
+++ ac3dec.c    2008-05-31 13:51:24.000000000 -0500
@@ -37,6 +37,7 @@
 #include "bitstream.h"
 #include "dsputil.h"
 #include "random.h"
+#include "crc.h"

 /**
  * Table of bin locations for rematrixing bands
@@ -1121,6 +1122,12 @@
         return -1;
     }

+    if (av_crc(av_crc8005, 0, buf + 2, buf_size - 2)) {
+           av_log(avctx, AV_LOG_ERROR, "CRC error\n");
+           *data_size = 0;
+           return buf_size;
+    }
+
     avctx->sample_rate = ctx->sampling_rate;
     avctx->bit_rate = ctx->bit_rate;


playbackbox.patch Don't show individual movie and holiday recordings outside of group

--- /home/paul/src/orig/mythtv-0.21.0+fixes16838/programs/mythfrontend/playbackbox.cpp  2008-02-26 23:12:15.000000000 -0600
+++ playbackbox.cpp     2008-05-31 11:50:19.000000000 -0500
@@ -1877,6 +1877,7 @@
                      ((recGroup == "All Programs") &&
                       ((viewMask & VIEW_LIVETVGRP) == 0))))
                 {
+                       if(p->recgroup != "Movies" && p->recgroup != "Holiday") {
                     sTitle = sortTitle(p->title, viewMask, titleSort,
                             p->recpriority);
                     sTitle = sTitle.lower();
@@ -1885,6 +1886,7 @@
                         sortedList[sTitle] = p->title;
                     progLists[sortedList[sTitle].lower()].prepend(p);
                     progLists[sortedList[sTitle].lower()].setAutoDelete(false);
+                       }
                 }

                 if ((viewMask & VIEW_RECGROUPS) &&
@@ -1925,7 +1927,8 @@
                     progLists[tmpTitle.lower()].setAutoDelete(false);
                 }

-                if ((viewMask & VIEW_WATCHLIST) && (p->recgroup != "LiveTV"))
+                if ((viewMask & VIEW_WATCHLIST) && (p->recgroup != "LiveTV")
+                    && (p->recgroup != "Movies") && (p->recgroup != "Holiday"))
                 {
                     if (watchListAutoExpire && !p->GetAutoExpireFromRecorded())
                     {


main.cpp (mythshutdown) don't shut down if a remote user is logged in

--- /home/paul/src/orig/mythtv-0.21.0+fixes16838/programs/mythshutdown/main.cpp 2008-02-14 18:15:43.000000000 -0600
+++ main.cpp    2008-05-31 11:38:21.000000000 -0500
@@ -137,16 +137,29 @@
     return RemoteGetRecordingStatus(NULL, false);
 }

+bool isRemoteLoggedIn()
+{
+       VERBOSE(VB_IMPORTANT, "Checking logged in users ....");
+       QString sCommand("last | head | grep 'pts/.*still logged in' | grep -v ':0.0'");
+       int res = system(sCommand.ascii());
+       if (WIFEXITED(res))
+               res = WEXITSTATUS(res);
+
+       VERBOSE(VB_IMPORTANT, QString("Exit status %1\n").arg(res));
+
+       return !res;
+}
+
 int getStatus(bool bWantRecStatus)
 {
-    VERBOSE(VB_GENERAL, "Mythshutdown: --status");
+       VERBOSE(VB_GENERAL, "Mythshutdown: --status");

-    int res = 0;
+       int res = 0;

-    if (isRunning("mythtranscode"))
-    {
-        VERBOSE(VB_IMPORTANT, "Transcoding in progress...");
-        res += 1;
+       if (isRunning("mythtranscode"))
+       {
+               VERBOSE(VB_IMPORTANT, "Transcoding in progress...");
+               res += 1;
     }

     if (isRunning("mythcommflag"))
@@ -155,11 +168,11 @@
         res += 2;
     }

-    if (isRunning("mythfilldatabas"))
-    {
-        VERBOSE(VB_IMPORTANT, "Grabbing EPG data in progress...");
-        res += 4;
-    }
+       if( isRemoteLoggedIn())
+       {
+               VERBOSE(VB_IMPORTANT, "Remote User connected...");
+               res += 4;
+       }

     if (bWantRecStatus && isRecording())
     {
@@ -173,7 +186,7 @@
         res += 16;
     }

-    if (JobQueue::HasRunningOrPendingJobs(15))
+    if (JobQueue::HasRunningOrPendingJobs(15) || isRunning("mythfilldatabas"))
     {
         VERBOSE(VB_IMPORTANT, "Has queued or pending jobs");
         res += 32;

welcomedialog.cpp (same as above)

 Index: welcomedialog.cpp
===================================================================
--- welcomedialog.cpp   (revision 14517)
+++ welcomedialog.cpp   (working copy)
@@ -634,7 +634,7 @@
     if (statusCode & 2)
         m_statusList.append(tr("MythTV is busy flagging commercials."));
     if (statusCode & 4)
-        m_statusList.append(tr("MythTV is busy grabbing EPG data."));
+        m_statusList.append(tr("A remote user is currently logged in."));
     if (statusCode & 16)
         m_statusList.append(tr("MythTV is locked by a user."));
     if (statusCode & 32)