From 76fcf258982f69fd1e4aec7bda99b81b9ccb3e95 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 May 2011 21:16:43 +0200 Subject: [PATCH] decoder/ffmpeg: use AVIOContext instead of ByteIOContext --- NEWS | 2 ++ src/decoder/ffmpeg_decoder_plugin.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 0e3d24dd5..4c36ab798 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.16.7 (2011/??/??) * input: - ffmpeg: support libavformat 0.7 +* decoder: + - ffmpeg: support libavformat 0.7 * output: - httpd: fix excessive buffering - openal: force 16 bit playback, as 8 bit doesn't work diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index 34a6b3ebd..9a3961b50 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -126,11 +126,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;