The branch, master has been updated
       via  6c07a4f5588d94f801bf35515626c28d101d2172 (commit)
      from  1b62f9d3ae6b66db60ac4725605eebd6e9d8be09 (commit)


- Log -----------------------------------------------------------------
commit 6c07a4f5588d94f801bf35515626c28d101d2172
Author:     yangsen5 <[email protected]>
AuthorDate: Thu Jul 31 17:05:07 2025 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Mon Aug 25 18:15:17 2025 +0800

    avformat/file: add pkt_size option
    
    The min_packet_size/max_packet_size were hardcoded to 256KB for
    performance. The new option makes it possible to configure a
    smaller packet size on embedded devices with limited memory
    resources.
    
    Signed-off-by: yangsen5 <[email protected]>
    Signed-off-by: Zhao Zhili <[email protected]>

diff --git a/libavformat/file.c b/libavformat/file.c
index a6eceff58d..97f5955f93 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -94,6 +94,7 @@ typedef struct FileContext {
     int fd;
     int trunc;
     int blocksize;
+    int pkt_size;
     int follow;
     int seekable;
 #if HAVE_DIRENT_H
@@ -106,6 +107,7 @@ static const AVOption file_options[] = {
     { "blocksize", "set I/O operation maximum block size", 
offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, 
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
     { "follow", "Follow a file as it is being written", offsetof(FileContext, 
follow), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "seekable", "Sets if the file is seekable", offsetof(FileContext, 
seekable), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 0, AV_OPT_FLAG_DECODING_PARAM | 
AV_OPT_FLAG_ENCODING_PARAM },
+    { "pkt_size", "Maximum packet size", offsetof(FileContext, pkt_size), 
AV_OPT_TYPE_INT, { .i64 = 262144 }, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM | 
AV_OPT_FLAG_ENCODING_PARAM },
     { NULL }
 };
 
@@ -313,7 +315,7 @@ static int file_open(URLContext *h, const char *filename, 
int flags)
     /* Buffer writes more than the default 32k to improve throughput especially
      * with networked file systems */
     if (!h->is_streamed && flags & AVIO_FLAG_WRITE)
-        h->min_packet_size = h->max_packet_size = 262144;
+        h->min_packet_size = h->max_packet_size = c->pkt_size;
 
     if (c->seekable >= 0)
         h->is_streamed = !c->seekable;
diff --git a/libavformat/version.h b/libavformat/version.h
index af7d0a1024..cc56b7cf5c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 #include "version_major.h"
 
 #define LIBAVFORMAT_VERSION_MINOR   4
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                LIBAVFORMAT_VERSION_MINOR, \

-----------------------------------------------------------------------

Summary of changes:
 libavformat/file.c    | 4 +++-
 libavformat/version.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to