summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c6
-rw-r--r--demux/demux.h5
2 files changed, 5 insertions, 6 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 55dfd259da..fedc533926 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -112,6 +112,8 @@ struct demux_internal {
bool idle;
bool autoselect;
double min_secs;
+ int max_packs;
+ int max_bytes;
bool tracks_switched; // thread needs to inform demuxer of this
@@ -391,7 +393,7 @@ static bool read_packet(struct demux_internal *in)
}
MP_DBG(in, "packets=%zd, bytes=%zd, active=%d, more=%d\n",
packs, bytes, active, read_more);
- if (packs >= MAX_PACKS || bytes >= MAX_PACK_BYTES) {
+ if (packs >= in->max_packs || bytes >= in->max_bytes) {
if (!in->warned_queue_overflow) {
in->warned_queue_overflow = true;
MP_ERR(in, "Too many packets in the demuxer packet queues:\n");
@@ -957,6 +959,8 @@ static struct demuxer *open_given_type(struct mpv_global *global,
.d_buffer = talloc(demuxer, struct demuxer),
.d_user = demuxer,
.min_secs = demuxer->opts->demuxer_min_secs,
+ .max_packs = demuxer->opts->demuxer_max_packs,
+ .max_bytes = demuxer->opts->demuxer_max_bytes,
};
pthread_mutex_init(&in->lock, NULL);
pthread_cond_init(&in->wakeup, NULL);
diff --git a/demux/demux.h b/demux/demux.h
index 22c7323ef1..710073d26c 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -30,11 +30,6 @@
#include "packet.h"
#include "stheader.h"
-// Maximum total size of packets queued - if larger, no new packets are read,
-// and the demuxer pretends EOF was reached.
-#define MAX_PACKS 16000
-#define MAX_PACK_BYTES (400 * 1024 * 1024)
-
// DEMUXER control commands/answers
#define DEMUXER_CTRL_NOTIMPL -1
#define DEMUXER_CTRL_DONTKNOW 0