summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-21 01:37:56 +0200
committerwm4 <wm4@nowhere>2019-10-21 01:38:25 +0200
commit9565ff522b946489c43508444c5e04812d1bdbbb (patch)
tree57dac57fa965e3bb1628d14e167dedd3f0be9e2e /demux/demux_lavf.c
parent5dba244c226383f9f3b15b07dfa5133ad08b6497 (diff)
downloadmpv-9565ff522b946489c43508444c5e04812d1bdbbb.tar.bz2
mpv-9565ff522b946489c43508444c5e04812d1bdbbb.tar.xz
build: add --enable-ffmpeg-strict-abi option
This can be used by distros to disable all known FFmpeg ABI violations. Currently only 1 is known, in demux_lavf.c. In addition to if-defing out the access to the private FFmpeg field, this disables the possibly fragile nested open callbacks, which make sense only if the aforementioned field can be accessed.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index c7eeb0b13e..670b611375 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -247,6 +247,7 @@ static void update_read_stats(struct demuxer *demuxer)
for (int n = 0; n < priv->num_nested; n++) {
struct nested_stream *nest = &priv->nested[n];
+#if !HAVE_FFMPEG_STRICT_ABI
// Note: accessing the bytes_read field is not allowed by FFmpeg's API.
// This is fully intentional - there is no other way to get this
// information (not even by custom I/O, because the connection reuse
@@ -255,6 +256,7 @@ static void update_read_stats(struct demuxer *demuxer)
int64_t new = cur - nest->last_bytes;
nest->last_bytes = cur;
demux_report_unbuffered_read_bytes(demuxer, new);
+#endif
}
}
@@ -970,8 +972,10 @@ static int demux_open_lavf(demuxer_t *demuxer, enum demux_check check)
if (demuxer->access_references) {
priv->default_io_open = avfc->io_open;
priv->default_io_close = avfc->io_close;
+#if !HAVE_FFMPEG_STRICT_ABI
avfc->io_open = nested_io_open;
avfc->io_close = nested_io_close;
+#endif
} else {
avfc->io_open = block_io_open;
}