- //wait 200 ms ??!? some icecast servers seem to not push data to us fast enough ?!?!?
- poll(0,0,200);
- if ((mp3_stream.numbytes=recv(mp3_stream.sockfd, mp3_stream.buf, MAX_PACKET_SIZE-1, 0)) == -1) {
- perror("recv");
- return MP3_ERROR;
+ mp3_stream.numbytes = 0;
+ while(mp3_stream.numbytes < MAX_PACKET_SIZE-1) {
+ if ((mp3_stream.numbytes += recv(mp3_stream.sockfd, &mp3_stream.buf[mp3_stream.numbytes], MAX_PACKET_SIZE - 1 - mp3_stream.numbytes, 0)) == -1) {
+ perror("recv");
+ return MP3_ERROR;
+ }