# HG changeset patch # User reimar # Date 1401218527 0 # Node ID f5b5c724643938408812b9153d97ffe6f9cd80a6 # Parent 608c83ef5c0c94e197d08dfc922312e752a89611 bluray: add some missing stream controls. Will all exact time-based seeking and displaying the correct time and duration. diff -r 608c83ef5c0c -r f5b5c7246439 stream/stream_bluray.c --- a/stream/stream_bluray.c Tue May 27 13:52:52 2014 +0000 +++ b/stream/stream_bluray.c Tue May 27 19:22:07 2014 +0000 @@ -198,6 +198,25 @@ 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;