subscriptions: reporting of subs output caused passthru streams to crash

I had forgotten that MPEGTS passes raw pktbuf not pkt and so was attempting
to incorrectly extract the length and causing it to crash.
This commit is contained in:
Adam Sutton 2013-09-12 22:48:22 +01:00
parent 83f6524344
commit bb72cd525d
2 changed files with 15 additions and 7 deletions

View file

@ -424,10 +424,14 @@ dvr_thread(void *aux)
continue;
}
if (de->de_s && started &&
(sm->sm_type == SMT_PACKET || sm->sm_type == SMT_MPEGTS)) {
th_pkt_t *pkt = sm->sm_data;
atomic_add(&de->de_s->ths_bytes_out, pktbuf_len(pkt->pkt_payload));
if (de->de_s && started) {
pktbuf_t *pb = NULL;
if (sm->sm_type == SMT_PACKET)
pb = ((th_pkt_t*)sm->sm_data)->pkt_payload;
else if (sm->sm_type == SMT_MPEGTS)
pb = sm->sm_data;
if (pb)
atomic_add(&de->de_s->ths_bytes_out, pktbuf_len(pb));
}
TAILQ_REMOVE(&sq->sq_queue, sm, sm_link);

View file

@ -274,9 +274,13 @@ http_stream_run(http_connection_t *hc, streaming_queue_t *sq,
case SMT_MPEGTS:
case SMT_PACKET:
if(started) {
th_pkt_t *pkt = sm->sm_data;
atomic_add(&s->ths_bytes_out, pktbuf_len(pkt->pkt_payload));
muxer_write_pkt(mux, sm->sm_type, pkt);
pktbuf_t *pb;;
if (sm->sm_type == SMT_PACKET)
pb = ((th_pkt_t*)sm->sm_data)->pkt_payload;
else
pb = sm->sm_data;
atomic_add(&s->ths_bytes_out, pktbuf_len(pb));
muxer_write_pkt(mux, sm->sm_type, sm->sm_data);
sm->sm_data = NULL;
}
break;