aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-05-09 21:16:43 +0200
committerMax Kellermann <max@duempel.org>2012-01-04 21:47:47 +0100
commit76fcf258982f69fd1e4aec7bda99b81b9ccb3e95 (patch)
tree68939ca6f5c12a57beba276e7e14a21d01f73cc1 /src/decoder
parent56257f072bd6b55c9eacf08e1875d45e45635a89 (diff)
downloadmpd-76fcf258982f69fd1e4aec7bda99b81b9ccb3e95.tar.gz
mpd-76fcf258982f69fd1e4aec7bda99b81b9ccb3e95.tar.xz
mpd-76fcf258982f69fd1e4aec7bda99b81b9ccb3e95.zip
decoder/ffmpeg: use AVIOContext instead of ByteIOContext
Diffstat (limited to '')
-rw-r--r--src/decoder/ffmpeg_decoder_plugin.c8
1 files changed, 8 insertions, 0 deletions
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;