Hi,
I'd like to port a (very basic) mp3 internet radio player to emscripten.
The original C code uses libcurl, but the whole libcurl code is just
something like:
// curl stream callback
size_t stream_callback(char *ptr, size_t size, size_t nmemb, void *userdata)
{
[...]
}
int main(int argc, char* argv[]) {
CURL *c;CURLcode res;
const char * webaddr = NULL;/* URL of the radio-station in
<ip-addr>:<port> format */
c = curl_easy_init();
curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, stream_callback);
curl_easy_setopt (c, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt (c, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_easy_setopt(c, CURLOPT_URL, webaddr);
res = curl_easy_perform(c);
/* curl_easy_perform(...) never returns unless user forces
stream_callback to return 0, that results in res==CURLE_WRITE_ERROR */
curl_easy_cleanup(c);
return 0;
}
Basically I've seen that emscripten provides other ways to replace libcurl
(the emscripten_async_wget() function family), but, as far as I can
understand from the docs, there's no way to handle an "infinite" stream
(because in the example code "stream_callback(...)" never stops (unless
user wants it to stop).
Is there a way to do the same in emscripten?
Thank you in advance.
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/d1700885-f648-4393-abe0-be3370f68432o%40googlegroups.com.