]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: Add data errors field
authorJaroslav Kysela <perex@perex.cz>
Fri, 30 Jan 2015 21:08:55 +0000 (22:08 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 30 Jan 2015 21:53:34 +0000 (22:53 +0100)
src/dvr/dvr.h
src/dvr/dvr_db.c
src/dvr/dvr_rec.c
src/webui/static/app/dvr.js

index a8a1258327470f1f116c927e602f922beb5e67c5..4a996c3e015424f49d684cb5094ab5e133d17c3c 100644 (file)
@@ -194,6 +194,11 @@ typedef struct dvr_entry {
    */
   uint32_t de_errors;
 
+  /**
+   * Number of data errors (only to be modified by the recording thread)
+   */
+  uint32_t de_data_errors;
+
   /**
    * Last error, see SM_CODE_ defines
    */
index f05ca86b001887119860e8be95078ec92ab15592..59a8332522bfc3d3690c6af71af3f85a75102c2a 100644 (file)
@@ -1887,6 +1887,13 @@ const idclass_t dvr_entry_class = {
       .off      = offsetof(dvr_entry_t, de_errors),
       .opts     = PO_RDONLY,
     },
+    {
+      .type     = PT_U32,
+      .id       = "data_errors",
+      .name     = "Data Errors",
+      .off      = offsetof(dvr_entry_t, de_data_errors),
+      .opts     = PO_RDONLY,
+    },
     {
       .type     = PT_U16,
       .id       = "dvb_eid",
index 7101f2a09f03decb1a2065caaa53862f6f3a087d..16c5ca5391d9994002df5ee2284e2a9d328fcbee 100644 (file)
@@ -483,6 +483,7 @@ dvr_thread(void *aux)
   profile_chain_t *prch = de->de_chain;
   streaming_queue_t *sq = &prch->prch_sq;
   streaming_message_t *sm;
+  th_subscription_t *ts;
   th_pkt_t *pkt;
   int run = 1;
   int started = 0;
@@ -498,14 +499,19 @@ dvr_thread(void *aux)
       continue;
     }
 
-    if (de->de_s && started) {
+    if ((ts = de->de_s) != NULL && started) {
       pktbuf_t *pb = NULL;
       if (sm->sm_type == SMT_PACKET)
         pb = ((th_pkt_t*)sm->sm_data)->pkt_payload;
       else if (sm->sm_type == SMT_MPEGTS)
         pb = sm->sm_data;
-      if (pb)
-        atomic_add(&de->de_s->ths_bytes_out, pktbuf_len(pb));
+      if (pb) {
+        atomic_add(&ts->ths_bytes_out, pktbuf_len(pb));
+        if (ts->ths_total_err != de->de_data_errors) {
+          de->de_data_errors = ts->ths_total_err;
+          idnode_notify_simple(&de->de_id);
+        }
+      }
     }
 
     TAILQ_REMOVE(&sq->sq_queue, sm, sm_link);
index 960dc25294427ac74167b530028cec4c0dc593c1..de071e37eb4489c7edcd74f9e77b0903d7779a30 100644 (file)
@@ -216,7 +216,7 @@ tvheadend.dvr_upcoming = function(panel, index) {
         del: true,
         list: 'disp_title,episode,pri,start_real,stop_real,' +
               'duration,channel,owner,creator,config_name,' +
-              'sched_status,comment',
+              'sched_status,errors,data_errors,comment',
         sort: {
           field: 'start_real',
           direction: 'ASC'
@@ -279,7 +279,7 @@ tvheadend.dvr_finished = function(panel, index) {
                      'The associated file will be removed from the storage.',
         list: 'disp_title,episode,start_real,stop_real,' +
               'duration,filesize,channelname,owner,creator,' +
-              'sched_status,url,comment',
+              'sched_status,errors,data_errors,url,comment',
         columns: {
             filesize: {
                 renderer: tvheadend.filesizeRenderer()
@@ -359,7 +359,7 @@ tvheadend.dvr_failed = function(panel, index) {
                      'The associated file will be removed from the storage.',
         list: 'disp_title,episode,start_real,stop_real,' +
               'duration,filesize,channelname,owner,creator,' +
-              'status,sched_status,url,comment',
+              'status,sched_status,errors,data_errors,url,comment',
         columns: {
             filesize: {
                 renderer: tvheadend.filesizeRenderer()