diff options
author | Petri Hintukainen <phintuka@users.sourceforge.net> | 2014-04-19 00:02:26 +0300 |
---|---|---|
committer | Petri Hintukainen <phintuka@users.sourceforge.net> | 2014-04-19 00:02:26 +0300 |
commit | 2379b4879d4a8efb93f514227c13132206ee7393 (patch) | |
tree | ae65e8b725c1233126abaf760c2199c92de197e9 | |
parent | e864b8844cd25b57ff6e1893539df6b06c8c0f02 (diff) | |
download | xine-lib-2379b4879d4a8efb93f514227c13132206ee7393.tar.gz xine-lib-2379b4879d4a8efb93f514227c13132206ee7393.tar.bz2 |
demux_avformat: add support for recent versions of libav fork.
-rw-r--r-- | m4/input.m4 | 2 | ||||
-rw-r--r-- | src/combined/ffmpeg/demux_avformat.c | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/m4/input.m4 b/m4/input.m4 index 0e54a79e0..12d2c4b2a 100644 --- a/m4/input.m4 +++ b/m4/input.m4 @@ -189,7 +189,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ dnl libavformat XINE_ARG_ENABLE([avformat], [Enable libavformat support]) if test "x$enable_avformat" != "xno"; then - PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 55.19.0], [have_avformat=yes], [have_avformat=no]) + PKG_CHECK_MODULES([AVFORMAT], [libavformat >= 53.21.1], [have_avformat=yes], [have_avformat=no]) if test x"$hard_enable_avformat" = x"yes" && test x"$have_avformat" != x"yes"; then AC_MSG_ERROR([libavformat support requested, but library not found]) fi diff --git a/src/combined/ffmpeg/demux_avformat.c b/src/combined/ffmpeg/demux_avformat.c index d73b491a2..5e717b375 100644 --- a/src/combined/ffmpeg/demux_avformat.c +++ b/src/combined/ffmpeg/demux_avformat.c @@ -319,6 +319,24 @@ static uint32_t audio_codec_lookup(avformat_demux_plugin_t *this, int id) { return 0; } +/* copied from libavformat/utils.c (not available in recent libav API) */ +static AVProgram *_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int s) +{ + int i, j; + + for (i = 0; i < ic->nb_programs; i++) { + if (ic->programs[i] == last) { + last = NULL; + } else { + if (!last) + for (j = 0; j < ic->programs[i]->nb_stream_indexes; j++) + if (ic->programs[i]->stream_index[j] == s) + return ic->programs[i]; + } + } + return NULL; +} + static int find_avformat_streams(avformat_demux_plugin_t *this) { AVProgram *p = NULL; @@ -360,7 +378,7 @@ static int find_avformat_streams(avformat_demux_plugin_t *this) { /* get audio tracks of the program */ if (this->video_stream_idx >= 0) { - p = av_find_program_from_stream(this->fmt_ctx, NULL, this->video_stream_idx); + p = _find_program_from_stream(this->fmt_ctx, NULL, this->video_stream_idx); } nb_streams = p ? p->nb_stream_indexes : this->fmt_ctx->nb_streams; |