Commit 1cfc5386 authored by hpi1's avatar hpi1

Added bd_read_skip_still()

This function is used to continue reading after still mode clip.

NOTE:
Before this change bd_read() jumped to next clip automatically.
Now bd_read() continues to next clip only after call to bd_read_skip_still().
parent 46ee2766
......@@ -1173,7 +1173,10 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
return 0;
}
if (pi->still_mode == BLURAY_STILL_TIME) {
_queue_event(bd, (BD_EVENT){BD_EVENT_STILL_TIME, pi->still_time});
if (bd->event_queue) {
_queue_event(bd, (BD_EVENT){BD_EVENT_STILL_TIME, pi->still_time});
return 0;
}
}
// find next clip
......@@ -1186,14 +1189,6 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
if (!_open_m2ts(bd, st)) {
return -1;
}
// timed still mode: allow application to process BD_EVENT_STILL_TIME.
// next bd_read() will return new data.
if (bd->event_queue) {
if (pi->still_mode == BLURAY_STILL_TIME) {
return 0;
}
}
}
if (_read_block(bd, st, bd->int_buf)) {
......@@ -1231,6 +1226,24 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
return -1;
}
int bd_read_skip_still(BLURAY *bd)
{
BD_STREAM *st = &bd->st0;
if (st->clip) {
MPLS_PI *pi = &st->clip->title->pl->play_item[st->clip->ref];
if (pi->still_mode == BLURAY_STILL_TIME) {
st->clip = nav_next_clip(bd->title, st->clip);
if (st->clip) {
return _open_m2ts(bd, st);
}
}
}
return 0;
}
/*
* preloader for asynchronous sub paths
*/
......
......@@ -252,6 +252,15 @@ int64_t bd_seek_time(BLURAY *bd, uint64_t tick);
*/
int bd_read(BLURAY *bd, unsigned char *buf, int len);
/**
*
* Continue reading after still mode clip
*
* @param bd BLURAY object
* @return 0 on error
*/
int bd_read_skip_still(BLURAY *bd);
/**
*
* Seek to a chapter. First chapter is 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment