Commit c74edd0e authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: use AVIOContext instead of ByteIOContext

parent 98acf3f2
...@@ -9,6 +9,7 @@ ver 0.17 (2011/??/??) ...@@ -9,6 +9,7 @@ ver 0.17 (2011/??/??)
* decoder: * decoder:
- mpg123: implement seeking - mpg123: implement seeking
- ffmpeg: drop support for pre-0.5 ffmpeg - ffmpeg: drop support for pre-0.5 ffmpeg
- ffmpeg: support libavformat 0.7
* output: * output:
- osx: allow user to specify other audio devices - osx: allow user to specify other audio devices
- raop: new output plugin - raop: new output plugin
......
...@@ -75,7 +75,11 @@ struct mpd_ffmpeg_stream { ...@@ -75,7 +75,11 @@ struct mpd_ffmpeg_stream {
struct decoder *decoder; struct decoder *decoder;
struct input_stream *input; struct input_stream *input;
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,101,0)
AVIOContext *io;
#else
ByteIOContext *io; ByteIOContext *io;
#endif
unsigned char buffer[8192]; unsigned char buffer[8192];
}; };
...@@ -108,11 +112,19 @@ mpd_ffmpeg_stream_open(struct decoder *decoder, struct input_stream *input) ...@@ -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); struct mpd_ffmpeg_stream *stream = g_new(struct mpd_ffmpeg_stream, 1);
stream->decoder = decoder; stream->decoder = decoder;
stream->input = input; 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), stream->io = av_alloc_put_byte(stream->buffer, sizeof(stream->buffer),
false, stream, false, stream,
mpd_ffmpeg_stream_read, NULL, mpd_ffmpeg_stream_read, NULL,
input->seekable input->seekable
? mpd_ffmpeg_stream_seek : NULL); ? mpd_ffmpeg_stream_seek : NULL);
#endif
if (stream->io == NULL) { if (stream->io == NULL) {
g_free(stream); g_free(stream);
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment