Project

General

Profile

Bug #4806 ยป mod_keep_autorec_ref_when_disabling.patch

Sebastian K., 2017-12-27 23:19

View differences:

./tvheadend-git.mod/src/dvr/dvr_autorec.c 2017-12-27 23:03:48.123103197 +0100
74 74
static epg_broadcast_t **
75 75
dvr_autorec_purge_spawns(dvr_autorec_entry_t *dae, int del, int disabled)
76 76
{
77
  dvr_entry_t *de;
77
  dvr_entry_t *de, *de_next;
78 78
  epg_broadcast_t **bcast = NULL, **nbcast;
79 79
  int i = 0, size = 0;
80
  while((de = LIST_FIRST(&dae->dae_spawns)) != NULL) {
81
    LIST_REMOVE(de, de_autorec_link);
82
    de->de_autorec = NULL;
80
  for (de = LIST_FIRST(&dae->dae_spawns); de != NULL; de = de_next) {
81
    de_next = LIST_NEXT(de, de_autorec_link);
83 82
    if (!del) continue;
84 83
    if (de->de_sched_state == DVR_SCHEDULED) {
85 84
      if (disabled && !de->de_enabled && de->de_bcast) {
......
95 94
          bcast[i++] = de->de_bcast;
96 95
        }
97 96
      }
97

  
98
      LIST_REMOVE(de, de_autorec_link);
99
      de->de_autorec = NULL;
98 100
      dvr_entry_cancel(de, 0);
99
    } else
101
    } else {
100 102
      idnode_changed(&de->de_id);
103
    }
101 104
  }
105

  
102 106
  if (bcast)
103 107
    bcast[i] = NULL;
108

  
104 109
  return bcast;
105 110
}
    (1-1/1)