/* * Update smt_start */ static void _update_smt_start ( timeshift_t *ts, streaming_start_t *ss ) { int i; if (ts->smt_start) streaming_start_unref(ts->smt_start); streaming_start_ref(ss); ts->smt_start = ss; /* Update video index */ for (i = 0; i < ss->ss_num_components; i++) if (SCT_ISVIDEO(ss->ss_components[i].ssc_type)) { ts->vididx = ss->ss_components[i].ssc_index; break; } }
streaming_message_t * streaming_msg_clone(streaming_message_t *src) { streaming_message_t *dst = malloc(sizeof(streaming_message_t)); streaming_start_t *ss; dst->sm_type = src->sm_type; #if ENABLE_TIMESHIFT dst->sm_time = src->sm_time; #endif switch(src->sm_type) { case SMT_PACKET: pkt_ref_inc(src->sm_data); dst->sm_data = src->sm_data; break; case SMT_START: ss = dst->sm_data = src->sm_data; streaming_start_ref(ss); break; case SMT_SKIP: dst->sm_data = malloc(sizeof(streaming_skip_t)); memcpy(dst->sm_data, src->sm_data, sizeof(streaming_skip_t)); break; case SMT_SIGNAL_STATUS: dst->sm_data = malloc(sizeof(signal_status_t)); memcpy(dst->sm_data, src->sm_data, sizeof(signal_status_t)); break; case SMT_DESCRAMBLE_INFO: dst->sm_data = malloc(sizeof(descramble_info_t)); memcpy(dst->sm_data, src->sm_data, sizeof(descramble_info_t)); break; case SMT_TIMESHIFT_STATUS: dst->sm_data = malloc(sizeof(timeshift_status_t)); memcpy(dst->sm_data, src->sm_data, sizeof(timeshift_status_t)); break; case SMT_GRACE: case SMT_SPEED: case SMT_STOP: case SMT_SERVICE_STATUS: case SMT_NOSTART: case SMT_NOSTART_WARN: dst->sm_code = src->sm_code; break; case SMT_EXIT: break; case SMT_MPEGTS: pktbuf_ref_inc(src->sm_data); dst->sm_data = src->sm_data; break; default: abort(); } return dst; }