Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
memoryinfo: add 'MPEG-TS table queue' entry
  • Loading branch information
perexg committed May 13, 2016
1 parent 1936395 commit 99f199f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/input/mpegts.c
Expand Up @@ -21,6 +21,7 @@
#include "memoryinfo.h"

extern memoryinfo_t mpegts_input_queue_memoryinfo;
extern memoryinfo_t mpegts_input_table_memoryinfo;

void
mpegts_init ( int linuxdvb_mask, int nosatip, str_list_t *satip_client,
Expand All @@ -35,6 +36,7 @@ mpegts_init ( int linuxdvb_mask, int nosatip, str_list_t *satip_client,

/* Memory info */
memoryinfo_register(&mpegts_input_queue_memoryinfo);
memoryinfo_register(&mpegts_input_table_memoryinfo);

/* FastScan init */
dvb_fastscan_init();
Expand Down
5 changes: 5 additions & 0 deletions src/input/mpegts/mpegts_input.c
Expand Up @@ -34,6 +34,7 @@
#include <sys/stat.h>

memoryinfo_t mpegts_input_queue_memoryinfo = { .my_name = "MPEG-TS input queue" };
memoryinfo_t mpegts_input_table_memoryinfo = { .my_name = "MPEG-TS table queue" };

static void
mpegts_input_del_network ( mpegts_network_link_t *mnl );
Expand Down Expand Up @@ -1389,6 +1390,7 @@ mpegts_input_process
memcpy(mtf->mtf_tsb, tsb, llen);
mtf->mtf_mux = mm;
mi->mi_table_queue_size += llen;
memoryinfo_alloc(&mpegts_input_table_memoryinfo, sizeof(mpegts_table_feed_t) + llen);
TAILQ_INSERT_TAIL(&mi->mi_table_queue, mtf, mtf_link);
table_wakeup = 1;
}
Expand Down Expand Up @@ -1527,6 +1529,7 @@ mpegts_input_thread ( void * p )

/* Flush */
while ((mp = TAILQ_FIRST(&mi->mi_input_queue))) {
memoryinfo_free(&mpegts_input_queue_memoryinfo, sizeof(mpegts_packet_t) + mp->mp_len);
TAILQ_REMOVE(&mi->mi_input_queue, mp, mp_link);
free(mp);
}
Expand All @@ -1553,6 +1556,7 @@ mpegts_input_table_thread ( void *aux )
continue;
}
mi->mi_table_queue_size -= mtf->mtf_len;
memoryinfo_free(&mpegts_input_table_memoryinfo, sizeof(mpegts_table_feed_t) + mtf->mtf_len);
TAILQ_REMOVE(&mi->mi_table_queue, mtf, mtf_link);
pthread_mutex_unlock(&mi->mi_output_lock);

Expand All @@ -1576,6 +1580,7 @@ mpegts_input_table_thread ( void *aux )

/* Flush */
while ((mtf = TAILQ_FIRST(&mi->mi_table_queue)) != NULL) {
memoryinfo_free(&mpegts_input_table_memoryinfo, sizeof(mpegts_table_feed_t) + mtf->mtf_len);
TAILQ_REMOVE(&mi->mi_table_queue, mtf, mtf_link);
free(mtf);
}
Expand Down

0 comments on commit 99f199f

Please sign in to comment.