From 9bf78ac40588595188a1c0e6cfdb45fda0902ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Wed, 24 Oct 2012 11:34:18 +0100 Subject: [PATCH] dvb: For full mux streaming, send more than one TS block in each packet --- src/dvb/dvb_adapter.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/dvb/dvb_adapter.c b/src/dvb/dvb_adapter.c index 7320db18..49db8b34 100644 --- a/src/dvb/dvb_adapter.c +++ b/src/dvb/dvb_adapter.c @@ -854,23 +854,27 @@ dvb_adapter_input_dvr(void *aux) int wakeup_table_feed = 0; // Just wanna wakeup once + pthread_mutex_lock(&tda->tda_delivery_mutex); + + if(LIST_FIRST(&tda->tda_streaming_pad.sp_targets) != NULL) { + streaming_message_t sm; + pktbuf_t *pb = pktbuf_alloc(tsb, r); + memset(&sm, 0, sizeof(sm)); + sm.sm_type = SMT_MPEGTS; + sm.sm_data = pb; + streaming_pad_deliver(&tda->tda_streaming_pad, &sm); + pktbuf_ref_dec(pb); + } + + + /* Process */ while (r >= 188) { /* sync */ if (tsb[i] == 0x47) { - if(LIST_FIRST(&tda->tda_streaming_pad.sp_targets) != NULL) { - streaming_message_t sm; - pktbuf_t *pb = pktbuf_alloc(tsb, 188); - memset(&sm, 0, sizeof(sm)); - sm.sm_type = SMT_MPEGTS; - sm.sm_data = pb; - streaming_pad_deliver(&tda->tda_streaming_pad, &sm); - pktbuf_ref_dec(pb); - } - if(!(tsb[i+1] & 0x80)) { // Only dispatch to table parser if not error int pid = (tsb[i+1] & 0x1f) << 8 | tsb[i+2];