diff stream/stream_dvdnav.c @ 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 8547ae79e74b
children 4038852b041e
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;