curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Missing data fragments when custom headers set

From: Firefox OS via curl-library <curl-library_at_cool.haxx.se>
Date: Sun, 24 Nov 2019 12:42:43 +0100

Dnia 2019-11-24, o godz. 10:21:07
tangram67 via curl-library <curl-library_at_cool.haxx.se> napisaƂ(a):

> Hi to all.
>
> I'm using libcurl as a receiver for MP3 radio streams.
> When using custom headers in conjunction with header and body data
> callbacks, some data is missing in the data callbacks. This is also
> reproducable when using the following command line:
>
> curl --header "Icy-MetaData: 1" -sD - -o ./ndr1.mp3
> http://ndr-edge-2061.dus-lg.cdn.addradio.net/ndr/ndr1niedersachsen/hannover/mp3/128/stream.mp3
>
> If you play the resulting MP3 file with some kind of media player you
> can hear dropdowns caused by missing data. If you remove the custom
> header, then the stream is OK. Also this behaviour is independant of the
> header value, so any header string will cause the problem.
>

Hi Dirk,

What makes you think the dropdowns are caused by missing data?

You requested the server to multiplex metadata with the MP3 stream.
You can't send such a stream directly to MP3 decoder. Instead,
your client needs to extract "icy-metaint:" response header and demux
the stream appropriately (extract the metadata instead of sending
them to MP3 decoder). Otherwise you're periodically feeding the decoder
with garbage.

Please cross-check your results with a client which doesn't use libcurl, e.g.
wget -S --header "Icy-MetaData: 1" -O ndr2.mp3 http://ndr-edge-2061.dus-lg.cdn.addradio.net/ndr/ndr1niedersachsen/hannover/mp3/128/stream.mp3

-- 
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2019-11-24