Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: Move dvr_entry_cancel() fcn
  • Loading branch information
perexg committed Sep 17, 2014
1 parent 6a90afd commit b9997bb
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions src/dvr/dvr_db.c
Expand Up @@ -1023,34 +1023,6 @@ dvr_entry_find_by_episode(epg_broadcast_t *e)
}
}

/**
*
*/
dvr_entry_t *
dvr_entry_cancel(dvr_entry_t *de)
{
switch(de->de_sched_state) {
case DVR_SCHEDULED:
dvr_entry_destroy(de, 1);
return NULL;

case DVR_RECORDING:
de->de_dont_reschedule = 1;
dvr_stop_recording(de, SM_CODE_ABORTED, 1);
return de;

case DVR_COMPLETED:
case DVR_MISSED_TIME:
case DVR_NOSTATE:
dvr_entry_destroy(de, 1);
return NULL;

default:
abort();
}
}


/**
* Unconditionally remove an entry
*/
Expand Down Expand Up @@ -2107,6 +2079,33 @@ dvr_entry_delete(dvr_entry_t *de)
dvr_entry_destroy(de, 1);
}

/**
*
*/
dvr_entry_t *
dvr_entry_cancel(dvr_entry_t *de)
{
switch(de->de_sched_state) {
case DVR_SCHEDULED:
dvr_entry_destroy(de, 1);
return NULL;

case DVR_RECORDING:
de->de_dont_reschedule = 1;
dvr_stop_recording(de, SM_CODE_ABORTED, 1);
return de;

case DVR_COMPLETED:
case DVR_MISSED_TIME:
case DVR_NOSTATE:
dvr_entry_destroy(de, 1);
return NULL;

default:
abort();
}
}

/**
*
*/
Expand Down

0 comments on commit b9997bb

Please sign in to comment.