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

reimar subversion at mplayerhq.hu
Wed Sep 17 19:49:55 CEST 2014


Author: reimar
Date: Wed Sep 17 19:49:55 2014
New Revision: 37282

Log:
bluray: check bd_seek result more thoroughly.

Also implement GET_SIZE stream control.

Modified:
   trunk/stream/stream_bluray.c

Modified: trunk/stream/stream_bluray.c
==============================================================================
--- trunk/stream/stream_bluray.c	Wed Sep 17 19:49:54 2014	(r37281)
+++ trunk/stream/stream_bluray.c	Wed Sep 17 19:49:55 2014	(r37282)
@@ -91,8 +91,12 @@ static int bluray_stream_seek(stream_t *
     int64_t p;
 
     p = bd_seek(b->bd, pos);
-    if (p == -1)
+    // bd_seek does not say what happens on errors,
+    // so be extra paranoid.
+    if (p < 0 || p != pos) {
+        s->pos = bd_tell(b->bd);
         return 0;
+    }
 
     s->pos = p;
     return 1;
@@ -205,6 +209,9 @@ static int bluray_stream_control(stream_
         *(double *)arg = ti->duration / 90000.0;
         return STREAM_OK;
     }
+    case STREAM_CTRL_GET_SIZE:
+        *(uint64_t*)arg = bd_get_title_size(b->bd);
+        return STREAM_OK;
 
     case STREAM_CTRL_GET_CURRENT_TIME:
         *(double *)arg = bd_tell_time(b->bd) / 90000.0;


More information about the MPlayer-cvslog mailing list