summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-10-30 09:13:32 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-10-30 09:13:32 +0000
commit9e15dfe7fce6053d8851a6cf031b26a3018dc242 (patch)
tree9d3821d7700a315668976d9125bee03f861a87e0
parent5ecff936b45423d0d82eb39aa6a1e706c8b3f099 (diff)
downloadmpv-9e15dfe7fce6053d8851a6cf031b26a3018dc242.tar.bz2
mpv-9e15dfe7fce6053d8851a6cf031b26a3018dc242.tar.xz
Provide DEMUXER_CTRL_GET_TIME_LENGTH and DEMUXER_CTRL_GET_PERCENT_POS.
Might need some more fine-tuning. together with rev. 1.318 of mencoder.c fixes bug #116 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16877 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/demux_demuxers.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libmpdemux/demux_demuxers.c b/libmpdemux/demux_demuxers.c
index 68e55dd716..a3e294a04c 100644
--- a/libmpdemux/demux_demuxers.c
+++ b/libmpdemux/demux_demuxers.c
@@ -107,6 +107,19 @@ static void demux_close_demuxers(demuxer_t* demuxer) {
}
+static int demux_demuxers_control(demuxer_t *demuxer,int cmd, void *arg){
+ dd_priv_t* priv = demuxer->priv;
+ switch (cmd) {
+ case DEMUXER_CTRL_GET_TIME_LENGTH:
+ *((double *)arg) = demuxer_get_time_length(priv->vd);
+ return DEMUXER_CTRL_OK;
+ case DEMUXER_CTRL_GET_PERCENT_POS:
+ *((int *)arg) = demuxer_get_percent_pos(priv->vd);
+ return DEMUXER_CTRL_OK;
+ }
+ return DEMUXER_CTRL_NOTIMPL;
+}
+
demuxer_desc_t demuxer_desc_demuxers = {
"Demuxers demuxer",
"", // Not selectable
@@ -120,5 +133,5 @@ demuxer_desc_t demuxer_desc_demuxers = {
NULL,
demux_close_demuxers,
demux_demuxers_seek,
- NULL
+ demux_demuxers_control
};