From c74edd0e339a81d55003ac4f8690eb4bd384fc6f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 May 2011 21:16:43 +0200 Subject: decoder/ffmpeg: use AVIOContext instead of ByteIOContext --- NEWS | 1 + src/decoder/ffmpeg_decoder_plugin.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 76b2befae..991f475d0 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ ver 0.17 (2011/??/??) * decoder: - mpg123: implement seeking - ffmpeg: drop support for pre-0.5 ffmpeg + - ffmpeg: support libavformat 0.7 * output: - osx: allow user to specify other audio devices - raop: new output plugin diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index c0bb8d6d5..068f64b83 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -75,7 +75,11 @@ struct mpd_ffmpeg_stream { struct decoder *decoder; struct input_stream *input; +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,101,0) + AVIOContext *io; +#else ByteIOContext *io; +#endif unsigned char buffer[8192]; }; @@ -108,11 +112,19 @@ mpd_ffmpeg_stream_open(struct decoder *decoder, struct input_stream *input) struct mpd_ffmpeg_stream *stream = g_new(struct mpd_ffmpeg_stream, 1); stream->decoder = decoder; stream->input = input; +#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,101,0) + stream->io = avio_alloc_context(stream->buffer, sizeof(stream->buffer), + false, stream, + mpd_ffmpeg_stream_read, NULL, + input->seekable + ? mpd_ffmpeg_stream_seek : NULL); +#else stream->io = av_alloc_put_byte(stream->buffer, sizeof(stream->buffer), false, stream, mpd_ffmpeg_stream_read, NULL, input->seekable ? mpd_ffmpeg_stream_seek : NULL); +#endif if (stream->io == NULL) { g_free(stream); return NULL; -- cgit v1.2.3