aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-08 16:15:41 +0000
committerGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-08 16:15:41 +0000
commit745c0b9c38e573172f6df7f52c9d0ef4baa5fc77 (patch)
treebedeecfabc347297160a15c2982f52738315e1d2 /libmpdemux
parent77a15dd6d3ec6307e4bd1976b350be54d2cf19ff (diff)
added :interleaving2, a better method to determine which stream whouls be flushed
at every iteration of the loop (based on the lowest percentage of buffer used - same algo as libavformat) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22947 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/muxer_mpeg.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libmpdemux/muxer_mpeg.c b/libmpdemux/muxer_mpeg.c
index 4366eebb49..9314be5307 100644
--- a/libmpdemux/muxer_mpeg.c
+++ b/libmpdemux/muxer_mpeg.c
@@ -83,6 +83,7 @@ static int conf_abuf_size = 0;
static int conf_vbuf_size = 0;
static int conf_drop = 0;
static int conf_telecine = 0;
+static int conf_interleaving2 = 0;
static float conf_telecine_src = 0;
static float conf_telecine_dest = 0;
@@ -204,6 +205,7 @@ m_option_t mpegopts_conf[] = {
{"drop", &conf_drop, CONF_TYPE_FLAG, M_OPT_GLOBAL, 0, 1, NULL},
{"tsaf", &conf_ts_allframes, CONF_TYPE_FLAG, M_OPT_GLOBAL, 0, 1, NULL},
{"telecine", &conf_telecine, CONF_TYPE_FLAG, M_OPT_GLOBAL, 0, PULLDOWN32, NULL},
+ {"interleaving2", &conf_interleaving2, CONF_TYPE_FLAG, M_OPT_GLOBAL, 0, 1, NULL},
{"film2pal", &conf_telecine, CONF_TYPE_FLAG, M_OPT_GLOBAL, 0, TELECINE_FILM2PAL, NULL},
{"tele_src", &(conf_telecine_src), CONF_TYPE_FLOAT, M_OPT_GLOBAL, 0, 0, NULL},
{"tele_dest", &(conf_telecine_dest), CONF_TYPE_FLOAT, M_OPT_GLOBAL, 0, 0, NULL},
@@ -1286,8 +1288,10 @@ static inline int find_best_stream(muxer_t *muxer)
muxer_priv_t *priv = muxer->priv;
muxer_headers_t *spriv;
pack_stats_t p;
+ unsigned int perc, sperc;
ndts = -1;
+ perc = -1;
//THIS RULE MUST ALWAYS apply: dts <= SCR + 0.7 seconds
for(i = 0; i < muxer->avih.dwStreams; i++)
@@ -1307,6 +1311,16 @@ static inline int find_best_stream(muxer_t *muxer)
dts = spriv->framebuf[0].dts;
ndts = i;
}
+
+ if(conf_interleaving2)
+ {
+ sperc = (spriv->track_bufsize * 1024) / spriv->max_buffer_size;
+ if(sperc < perc)
+ {
+ ndts = i;
+ perc = sperc;
+ }
+ }
}
return ndts;