Skip to content

Commit 93b9d2b

Browse files
committed
increase read buffer size
1 parent ae30885 commit 93b9d2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/C++/Apps/Mp4Mux/Mp4Mux.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"(c) 2002-20016 Axiomatic Systems, LLC"
4545

4646
const unsigned int AP4_MUX_DEFAULT_VIDEO_FRAME_RATE = 24;
47+
const unsigned int AP4_MUX_READ_BUFFER_SIZE = 65536;
4748

4849
/*----------------------------------------------------------------------
4950
| globals
@@ -301,7 +302,7 @@ AddAacTrack(AP4_Movie& movie,
301302
}
302303

303304
// read some data and feed the parser
304-
AP4_UI08 input_buffer[4096];
305+
AP4_UI08 input_buffer[AP4_MUX_READ_BUFFER_SIZE];
305306
AP4_Size to_read = parser.GetBytesFree();
306307
if (to_read) {
307308
AP4_Size bytes_read = 0;
@@ -381,7 +382,7 @@ AddH264Track(AP4_Movie& movie,
381382
AP4_AvcFrameParser parser;
382383
for (;;) {
383384
bool eos;
384-
unsigned char input_buffer[4096];
385+
unsigned char input_buffer[AP4_MUX_READ_BUFFER_SIZE];
385386
AP4_Size bytes_in_buffer = 0;
386387
result = input->ReadPartial(input_buffer, sizeof(input_buffer), bytes_in_buffer);
387388
if (AP4_SUCCEEDED(result)) {
@@ -602,7 +603,7 @@ AddH265Track(AP4_Movie& movie,
602603
AP4_HevcFrameParser parser;
603604
for (;;) {
604605
bool eos;
605-
unsigned char input_buffer[4096];
606+
unsigned char input_buffer[AP4_MUX_READ_BUFFER_SIZE];
606607
AP4_Size bytes_in_buffer = 0;
607608
result = input->ReadPartial(input_buffer, sizeof(input_buffer), bytes_in_buffer);
608609
if (AP4_SUCCEEDED(result)) {

0 commit comments

Comments
 (0)