stream_dvdnav: implement STREAM_CTRL_GET_NUM_TITLES for dvdnav

This commit provides impelmentation of STREAM_CTRL_GET_NUM_TITLES
for dvdnav stream. Other streams for DVD or Blu-ray are already
provide STREAM_CTRL_GET_NUM_TITLES.
This commit is contained in:
xylosper 2014-03-15 16:21:51 +09:00 committed by wm4
parent 16596d025a
commit 9e4014d876
1 changed files with 7 additions and 0 deletions

View File

@ -522,6 +522,13 @@ static int control(stream_t *stream, int cmd, void *arg)
} }
break; break;
} }
case STREAM_CTRL_GET_NUM_TITLES: {
int32_t num_titles = 0;
if (dvdnav_get_number_of_titles(dvdnav, &num_titles) != DVDNAV_STATUS_OK)
break;
*((unsigned int*)arg)= num_titles;
return STREAM_OK;
}
case STREAM_CTRL_GET_CURRENT_TITLE: { case STREAM_CTRL_GET_CURRENT_TITLE: {
if (dvdnav_current_title_info(dvdnav, &tit, &part) != DVDNAV_STATUS_OK) if (dvdnav_current_title_info(dvdnav, &tit, &part) != DVDNAV_STATUS_OK)
break; break;