[FFmpeg-devel] [PATCH] SHOUTcast HTTP Support
Ronald S. Bultje
Mon Jan 18 20:17:12 CET 2010
On Mon, Jan 18, 2010 at 12:05 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Problem: icy-metadata is in the HTTP header; the HTTP data icy
> metadata only comes after icy-metaint bytes in the HTTP datastream.
> This sucks. Also, this would not provide the metadata present in the
> HTTP header.
The HTTP header metadata should probably be provided as-is (in
AVMetadata, including icy-metaint) as part of the URLProtocol. Since
the metadata never changes, whatever opens URLProtocol (e.g.
av_open_*()) could then be held responsible for merging it with
whatever rules (as Michael suggested) into AVFormatContext.
That solves the HTTP header problem. Now, at this point it becomes a
little tricky, since how do you know that the stream is icy so you can
forward it to a demuxer? The optimal solution is to change the probe
callback prototype, but that might be considered hackish, and doesn't
solve the wget-case. I still think this is a thing to consider. A
second possibility is to search for icy-tags recurring at a regular
interval (where interval = metaint + metadatasize + 1). A combination
of these two might be optimal.
Then the icy demuxer is responsible for the rest of the magic, i.e.
reading the actual icy-data-tags and doing stuff with them as your
current patch does in the http demuxer.
What do others think of this?
More information about the ffmpeg-devel