changeset 22936:a6486d2975d2

implemented STREAM_CTRL_GET_CURRENT_TIME and STREAM_CTRL_SEEK_TO_TIME - dvdnav from mphq required
author nicodvb
date Mon, 09 Apr 2007 16:05:58 +0000
parents 23e746c5c15c
children afb6753cb2c7
files stream/stream_dvdnav.c
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_dvdnav.c	Mon Apr 09 15:08:29 2007 +0000
+++ b/stream/stream_dvdnav.c	Mon Apr 09 16:05:58 2007 +0000
@@ -328,6 +328,26 @@
       }
       break;
     }
+#ifdef MP_DVDNAV
+    case STREAM_CTRL_GET_CURRENT_TIME:
+    {
+      double tm;
+      tm = dvdnav_get_current_time(priv->dvdnav)/90000.0f;
+      if(tm != -1)
+      {
+        *((double *)arg) = tm;
+        return 1;
+      }
+      break;
+    }
+    case STREAM_CTRL_SEEK_TO_TIME:
+    {
+      uint64_t tm = (uint64_t) (*((double*)arg) * 90000);
+      if(dvdnav_time_search(priv->dvdnav, tm) == DVDNAV_STATUS_OK)
+        return 1;
+      break;
+    }
+#endif
   }
 
   return STREAM_UNSUPORTED;