changeset 16876:9dd44ff7ec32

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
author reimar
date Sun, 30 Oct 2005 09:13:32 +0000
parents 4951a3abcd1a
children 9081ae3a702c
files libmpdemux/demux_demuxers.c
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_demuxers.c	Sun Oct 30 09:11:40 2005 +0000
+++ b/libmpdemux/demux_demuxers.c	Sun Oct 30 09:13:32 2005 +0000
@@ -107,6 +107,19 @@
 }
   
 
+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 @@
   NULL,
   demux_close_demuxers,
   demux_demuxers_seek,
-  NULL
+  demux_demuxers_control
 };