[MPlayer-cvslog] r37209 - trunk/stream/stream_bluray.c

reimar subversion at mplayerhq.hu
Tue May 27 21:22:08 CEST 2014


Author: reimar
Date: Tue May 27 21:22:07 2014
New Revision: 37209

Log:
bluray: add some missing stream controls.

Will all exact time-based seeking and displaying the
correct time and duration.

Modified:
   trunk/stream/stream_bluray.c

Modified: trunk/stream/stream_bluray.c
==============================================================================
--- trunk/stream/stream_bluray.c	Tue May 27 15:52:52 2014	(r37208)
+++ trunk/stream/stream_bluray.c	Tue May 27 21:22:07 2014	(r37209)
@@ -198,6 +198,25 @@ static int bluray_stream_control(stream_
         return r ? 1 : STREAM_UNSUPPORTED;
     }
 
+    case STREAM_CTRL_GET_TIME_LENGTH: {
+        BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, b->current_title, b->current_angle);
+        if (!ti)
+            return STREAM_UNSUPPORTED;
+        *(double *)arg = ti->duration / 90000.0;
+        return STREAM_OK;
+    }
+
+    case STREAM_CTRL_GET_CURRENT_TIME:
+        *(double *)arg = bd_tell_time(b->bd) / 90000.0;
+        return STREAM_OK;
+    case STREAM_CTRL_SEEK_TO_TIME: {
+        int64_t res = bd_seek_time(b->bd, *(double*)arg * 90000.0);
+        if (res < 0)
+            return STREAM_ERROR;
+        s->pos = res;
+        return 1;
+    }
+
     case STREAM_CTRL_GET_NUM_ANGLES: {
         BLURAY_TITLE_INFO *ti;
 


More information about the MPlayer-cvslog mailing list