[FFmpeg-devel] Patch for chained OGG files
Måns Rullgård
mans
Sat Apr 3 18:37:09 CEST 2010
Cyril Zorin <cyril.zorin at gmail.com> writes:
> Hi!
>
> Attached is a patch that lets ffmpeg handle chained OGG files, often used in
> internet radio streams. Let me know if there's anything to change.
>
> +static int
> +ogg_read_packet (AVFormatContext * s, AVPacket * pkt)
> +{
> + const int result = ogg_read_packet_internal(s, pkt);
> + if (result >= 0)
> + return result;
> +
> + ogg_read_close(s);
> + memset(s->priv_data, 0, sizeof(struct ogg));
> + if (ogg_read_header(s, 0) < 0)
> + return AVERROR(EIO);
> +
> + return ogg_read_packet_internal(s, pkt);
> +}
This won't work if the parameters of the new set of streams don't
exactly match the old. Libavformat simply doesn't support randomly
changing streams halfway through a file.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list