Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Scholz <epirat07@gmail.com>2021-11-22 02:25:16 +0300
committerAnton Khirnov <anton@khirnov.net>2021-12-04 16:06:30 +0300
commitc6f4e10111debf5b547a399661a5fe997d761033 (patch)
tree9db0998c6104fe6985540de95665e7bdbd3b81b2 /libavformat/hdsenc.c
parenta7df966c82b991ea4f05c40ff5efab65ce56308e (diff)
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/hdsenc.c')
-rw-r--r--libavformat/hdsenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 64d9f1413d..2a52019120 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -368,7 +368,7 @@ static int hds_write_header(AVFormatContext *s)
ctx->flags = s->flags;
ctx->pb = avio_alloc_context(os->iobuf, sizeof(os->iobuf),
- AVIO_FLAG_WRITE, os,
+ 1, os,
NULL, hds_write, NULL);
if (!ctx->pb) {
return AVERROR(ENOMEM);