From: Andreas Ă–man Date: Mon, 21 Jun 2010 19:23:13 +0000 (+0000) Subject: Need to init ptsq + some cosmetics X-Git-Tag: 2.12~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ccfa89afeeaab4d031a56d2ee24b50969b7d056;p=thirdparty%2Ftvheadend.git Need to init ptsq + some cosmetics --- diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index 4726a2874..f56c38f95 100644 --- a/src/plumbing/tsfix.c +++ b/src/plumbing/tsfix.c @@ -61,17 +61,6 @@ typedef struct tsfix { } tsfix_t; -/** - * - */ -static void -tsfix_destroy_stream(tfstream_t *tfs) -{ - LIST_REMOVE(tfs, tfs_link); - free(tfs); -} - - /** * */ @@ -79,9 +68,11 @@ static void tsfix_destroy_streams(tsfix_t *tf) { tfstream_t *tfs; - while((tfs = LIST_FIRST(&tf->tf_streams)) != NULL) - tsfix_destroy_stream(tfs); pktref_clear_queue(&tf->tf_ptsq); + while((tfs = LIST_FIRST(&tf->tf_streams)) != NULL) { + LIST_REMOVE(tfs, tfs_link); + free(tfs); + } } @@ -290,9 +281,6 @@ recover_pts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt) /** * Compute PTS (if not known) - * - * We do this by placing packets on a queue and wait for next I/P - * frame to appear */ static void compute_pts(tsfix_t *tf, tfstream_t *tfs, th_pkt_t *pkt) @@ -321,7 +309,6 @@ tsfix_input_packet(tsfix_t *tf, streaming_message_t *sm) { th_pkt_t *pkt = pkt_copy(sm->sm_data); tfstream_t *tfs = tfs_find(tf, pkt); - streaming_msg_free(sm); if(tfs == NULL) { @@ -398,6 +385,8 @@ tsfix_create(streaming_target_t *output) { tsfix_t *tf = calloc(1, sizeof(tsfix_t)); + TAILQ_INIT(&tf->tf_ptsq); + tf->tf_output = output; streaming_target_init(&tf->tf_input, tsfix_input, tf, 0); return &tf->tf_input;