ref: c6eb40f82bc721293461a00574fdbeee473a1a89
parent: 5cfa93b0920deba03080e3e59da970c1c8f24b5f
author: Gregory Maxwell <[email protected]>
date: Wed Nov 26 15:16:49 EST 2008
Celtclient improvements: A usable usage message and correct usage of the jitter buffer.
--- a/tools/celtclient.c
+++ b/tools/celtclient.c
@@ -75,13 +75,13 @@
if (argc != 5)
{
- fprintf(stderr, "wrong options\n");
+ fprintf(stderr, "Usage %s plughw:0,0 remote_host local_udp_port remote_udp_port\n",argv[0]);
exit(1);
}
h = gethostbyname(argv[2]);
if(h==NULL) {
- fprintf(stderr, "%s: unknown host '%s' \n", argv[0], argv[1]);
+ fprintf(stderr, "%s: unknown host '%s' \n", argv[0], argv[2]);
exit(1);
}
@@ -185,7 +185,10 @@
/* Get audio from the jitter buffer */
packet.data = msg;
packet.len = MAX_MSG;
+ jitter_buffer_tick(jitter);
jitter_buffer_get(jitter, &packet, FRAME_SIZE, NULL);
+ if (packet.len==0)
+ packet.data=NULL;
celt_decode(dec_state, packet.data, packet.len, pcm);
} else {
for (i=0;i<FRAME_SIZE;i++)