History

stream_bluray: implement STREAM_CTRL_GET_TITLE_LENGTH

Kacper Michajłow committed 1 year ago

Commit d91eea21 parent b594fc21 file · +10 −0Browse files

Unified · Split

stream/stream_bluray.c+10−0
@@ -265,6 +265,16 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) · 264 unmodified lines
265265 bd_seamless_angle_change(b->bd, angle);
266266 return STREAM_OK;
267267 }
268+ case STREAM_CTRL_GET_TITLE_LENGTH: {
269+ int title = *(double *)arg;
270+ if (!b->bd || title < 0 || title >= b->num_titles)
271+ return STREAM_UNSUPPORTED;
272+ const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0);
273+ if (!ti)
274+ return STREAM_UNSUPPORTED;
275+ *(double *)arg = BD_TIME_TO_MP(ti->duration);
276+ return STREAM_OK;
277+ }
268278 case STREAM_CTRL_GET_LANG: {
269279 const BLURAY_TITLE_INFO *ti = b->title_info;
270280 if (ti && ti->clip_count) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t