From 29352bbbe2a8f00a72b12d5f38d70f2cf9d51a8a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 12 Oct 2024 11:37:04 +0530 Subject: [PATCH] Mark output buffers writeable --- src/calibre/utils/ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/ffmpeg.c b/src/calibre/utils/ffmpeg.c index 18723d0a6c..c6dcf67cfc 100644 --- a/src/calibre/utils/ffmpeg.c +++ b/src/calibre/utils/ffmpeg.c @@ -172,8 +172,8 @@ open_output_file(Transcoder *t, PyObject *output_file) { static const size_t io_bufsize = 8192; uint8_t *input_buf; if (!(input_buf = av_malloc(io_bufsize))) { PyErr_NoMemory(); return NULL; } - if (t->seek_in_output) t->ofmt_ctx->pb = avio_alloc_context(input_buf, io_bufsize, 0, t, NULL, &write_packet, &seek_packet_output); - else t->ofmt_ctx->pb = avio_alloc_context(input_buf, io_bufsize, 0, t, NULL, &write_packet, NULL); + if (t->seek_in_output) t->ofmt_ctx->pb = avio_alloc_context(input_buf, io_bufsize, 1, t, NULL, &write_packet, &seek_packet_output); + else t->ofmt_ctx->pb = avio_alloc_context(input_buf, io_bufsize, 1, t, NULL, &write_packet, NULL); if (!t->ofmt_ctx->pb) { PyErr_NoMemory(); return NULL; } if (!(t->ofmt_ctx->oformat = av_guess_format(t->container_format, NULL, NULL))) {