]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvr: use direct error flag handling
authorJaroslav Kysela <perex@perex.cz>
Sat, 31 Jan 2015 15:53:07 +0000 (16:53 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 31 Jan 2015 15:53:07 +0000 (16:53 +0100)
src/dvr/dvr_rec.c

index 16c5ca5391d9994002df5ee2284e2a9d328fcbee..bd1ac54211743485b77104602c3bfb5a5f2a38c1 100644 (file)
@@ -501,17 +501,22 @@ dvr_thread(void *aux)
 
     if ((ts = de->de_s) != NULL && started) {
       pktbuf_t *pb = NULL;
-      if (sm->sm_type == SMT_PACKET)
+      if (sm->sm_type == SMT_PACKET) {
         pb = ((th_pkt_t*)sm->sm_data)->pkt_payload;
-      else if (sm->sm_type == SMT_MPEGTS)
+        if (((th_pkt_t*)sm->sm_data)->pkt_err) {
+          de->de_data_errors++;
+          idnode_notify_simple(&de->de_id);
+        }
+      }
+      else if (sm->sm_type == SMT_MPEGTS) {
         pb = sm->sm_data;
-      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;
+        if (pb->pb_err) {
+          de->de_data_errors += pb->pb_err;
           idnode_notify_simple(&de->de_id);
         }
       }
+      if (pb)
+        atomic_add(&ts->ths_bytes_out, pktbuf_len(pb));
     }
 
     TAILQ_REMOVE(&sq->sq_queue, sm, sm_link);