summaryrefslogtreecommitdiff
path: root/libavformat/tests
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2021-11-22 00:25:16 +0100
committerAnton Khirnov <anton@khirnov.net>2021-12-04 14:06:30 +0100
commitc6f4e10111debf5b547a399661a5fe997d761033 (patch)
tree9db0998c6104fe6985540de95665e7bdbd3b81b2 /libavformat/tests
parenta7df966c82b991ea4f05c40ff5efab65ce56308e (diff)
downloadffmpeg-c6f4e10111debf5b547a399661a5fe997d761033.tar.gz
avformat: do not use AVIO_FLAG_* with avio_alloc_context
The documentation states that here 0 should be used for read-only and 1 for a writable buffer. AVIO_FLAG_WRITE however is 2, while it works due to the way the flag is handled internally, it is still wrong according to the documentation. Additionally it makes it seem as if the AVIO_FLAG_* values could be used here, which is actually not true, as when AVIO_FLAG_READ would be used here it would create a writable buffer as AVIO_FLAG_READ is defined as 1. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat/tests')
-rw-r--r--libavformat/tests/movenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c
index 04155dde76..2af72f11c7 100644
--- a/libavformat/tests/movenc.c
+++ b/libavformat/tests/movenc.c
@@ -186,7 +186,7 @@ static void init_fps(int bf, int audio_preroll, int fps)
ctx->oformat = av_guess_format(format, NULL, NULL);
if (!ctx->oformat)
exit(1);
- ctx->pb = avio_alloc_context(iobuf, iobuf_size, AVIO_FLAG_WRITE, NULL, NULL, io_write, NULL);
+ ctx->pb = avio_alloc_context(iobuf, iobuf_size, 1, NULL, NULL, io_write, NULL);
if (!ctx->pb)
exit(1);
ctx->pb->write_data_type = io_write_data_type;