From 1ccfa89afeeaab4d031a56d2ee24b50969b7d056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Mon, 21 Jun 2010 19:23:13 +0000 Subject: [PATCH] Need to init ptsq + some cosmetics --- src/plumbing/tsfix.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/plumbing/tsfix.c b/src/plumbing/tsfix.c index 4726a287..f56c38f9 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;