diff --git a/src/satip/rtp.c b/src/satip/rtp.c index 5679f7a..d800c5a 100644 --- a/src/satip/rtp.c +++ b/src/satip/rtp.c @@ -33,7 +33,7 @@ #define RTP_PACKETS 128 #define RTP_PAYLOAD (7*188+12) -#define RTP_TCP_PAYLOAD (87*188+12+4) /* cca 16kB */ +#define RTP_TCP_PAYLOAD ((7*6*188)+12+4) /* less than 8kB (FFMpeg and others have troubles with >8kB) */ #define RTCP_PAYLOAD (1420) typedef struct satip_rtp_table { @@ -592,12 +592,11 @@ void satip_rtp_close(void *_rtp) tvh_cond_signal(&sq->sq_cond, 0); pthread_mutex_unlock(&sq->sq_mutex); pthread_mutex_unlock(&satip_rtp_lock); - if (rtp->port == RTSP_TCP_DATA) - pthread_mutex_lock(rtp->tcp_lock); pthread_join(rtp->tid, NULL); if (rtp->port == RTSP_TCP_DATA) { - pthread_mutex_unlock(rtp->tcp_lock); + pthread_mutex_lock(rtp->tcp_lock); free(rtp->tcp_data.iov_base); + pthread_mutex_unlock(rtp->tcp_lock); } else { udp_multisend_free(&rtp->um); }