Commit b82f5755 authored by Rafaël Carré's avatar Rafaël Carré

bluray: cosmetics

parent 1cf7e446
...@@ -235,9 +235,9 @@ static int blurayOpen( vlc_object_t *object ) ...@@ -235,9 +235,9 @@ static int blurayOpen( vlc_object_t *object )
/* */ /* */
p_demux->p_sys = p_sys = calloc(1, sizeof(*p_sys)); p_demux->p_sys = p_sys = calloc(1, sizeof(*p_sys));
if (unlikely(!p_sys)) { if (unlikely(!p_sys))
return VLC_ENOMEM; return VLC_ENOMEM;
}
p_sys->current_overlay = -1; p_sys->current_overlay = -1;
p_sys->i_audio_stream = -1; p_sys->i_audio_stream = -1;
p_sys->i_video_stream = -1; p_sys->i_video_stream = -1;
...@@ -363,9 +363,8 @@ static int blurayOpen( vlc_object_t *object ) ...@@ -363,9 +363,8 @@ static int blurayOpen( vlc_object_t *object )
vlc_array_init(&p_sys->es); vlc_array_init(&p_sys->es);
p_sys->p_out = esOutNew( p_demux ); p_sys->p_out = esOutNew( p_demux );
if (unlikely(p_sys->p_out == NULL)) { if (unlikely(p_sys->p_out == NULL))
goto error; goto error;
}
blurayResetParser( p_demux ); blurayResetParser( p_demux );
if (!p_sys->p_parser) { if (!p_sys->p_parser) {
...@@ -404,8 +403,8 @@ static void blurayClose( vlc_object_t *object ) ...@@ -404,8 +403,8 @@ static void blurayClose( vlc_object_t *object )
bd_close(p_sys->bluray); bd_close(p_sys->bluray);
if (p_sys->p_vout != NULL) { if (p_sys->p_vout != NULL) {
var_DelCallback(p_sys->p_vout, "mouse-moved", &onMouseEvent, p_demux); var_DelCallback(p_sys->p_vout, "mouse-moved", onMouseEvent, p_demux);
var_DelCallback(p_sys->p_vout, "mouse-clicked", &onMouseEvent, p_demux); var_DelCallback(p_sys->p_vout, "mouse-clicked", onMouseEvent, p_demux);
vlc_object_release(p_sys->p_vout); vlc_object_release(p_sys->p_vout);
} }
if (p_sys->p_input != NULL) if (p_sys->p_input != NULL)
...@@ -532,11 +531,11 @@ static es_out_t *esOutNew( demux_t *p_demux ) ...@@ -532,11 +531,11 @@ static es_out_t *esOutNew( demux_t *p_demux )
if ( unlikely(p_out == NULL) ) if ( unlikely(p_out == NULL) )
return NULL; return NULL;
p_out->pf_add = &esOutAdd; p_out->pf_add = esOutAdd;
p_out->pf_control = &esOutControl; p_out->pf_control = esOutControl;
p_out->pf_del = &esOutDel; p_out->pf_del = esOutDel;
p_out->pf_destroy = &esOutDestroy; p_out->pf_destroy = esOutDestroy;
p_out->pf_send = &esOutSend; p_out->pf_send = esOutSend;
p_out->p_sys = malloc( sizeof(*p_out->p_sys) ); p_out->p_sys = malloc( sizeof(*p_out->p_sys) );
if ( unlikely( p_out->p_sys == NULL ) ) { if ( unlikely( p_out->p_sys == NULL ) ) {
...@@ -624,12 +623,12 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic, ...@@ -624,12 +623,12 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
return; return;
} }
subpicture_region_t **p_dst = &(p_subpic->p_region); subpicture_region_t **p_dst = &p_subpic->p_region;
while (p_src != NULL) { while (p_src != NULL) {
*p_dst = subpicture_region_Clone(p_src); *p_dst = subpicture_region_Clone(p_src);
if (*p_dst == NULL) if (*p_dst == NULL)
break; break;
p_dst = &((*p_dst)->p_next); p_dst = &(*p_dst)->p_next;
p_src = p_src->p_next; p_src = p_src->p_next;
} }
if (*p_dst != NULL) if (*p_dst != NULL)
...@@ -847,7 +846,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov) ...@@ -847,7 +846,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
/* Now we can update the region, regardless it's an update or an insert */ /* Now we can update the region, regardless it's an update or an insert */
const BD_PG_RLE_ELEM *img = ov->img; const BD_PG_RLE_ELEM *img = ov->img;
for (int y = 0; y < ov->h; y++) { for (int y = 0; y < ov->h; y++)
for (int x = 0; x < ov->w;) { for (int x = 0; x < ov->w;) {
memset(p_reg->p_picture->p[0].p_pixels + memset(p_reg->p_picture->p[0].p_pixels +
y * p_reg->p_picture->p[0].i_pitch + x, y * p_reg->p_picture->p[0].i_pitch + x,
...@@ -855,7 +854,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov) ...@@ -855,7 +854,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
x += img->len; x += img->len;
img++; img++;
} }
}
if (ov->palette) { if (ov->palette) {
p_reg->fmt.p_palette->i_entries = 256; p_reg->fmt.p_palette->i_entries = 256;
for (int i = 0; i < 256; ++i) { for (int i = 0; i < 256; ++i) {
...@@ -865,6 +864,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov) ...@@ -865,6 +864,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
p_reg->fmt.p_palette->palette[i][3] = ov->palette[i].T; p_reg->fmt.p_palette->palette[i][3] = ov->palette[i].T;
} }
} }
vlc_mutex_unlock(&p_sys->p_overlays[ov->plane]->lock); vlc_mutex_unlock(&p_sys->p_overlays[ov->plane]->lock);
/* /*
* /!\ The region is now stored in our internal list, but not in the subpicture /!\ * /!\ The region is now stored in our internal list, but not in the subpicture /!\
...@@ -880,23 +880,24 @@ static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay) ...@@ -880,23 +880,24 @@ static void blurayOverlayProc(void *ptr, const BD_OVERLAY *const overlay)
blurayCloseAllOverlays(p_demux); blurayCloseAllOverlays(p_demux);
return; return;
} }
switch (overlay->cmd) { switch (overlay->cmd) {
case BD_OVERLAY_INIT: case BD_OVERLAY_INIT:
msg_Info(p_demux, "Initializing overlay"); msg_Info(p_demux, "Initializing overlay");
blurayInitOverlay(p_demux, overlay->plane, overlay->w, overlay->h); blurayInitOverlay(p_demux, overlay->plane, overlay->w, overlay->h);
break; break;
case BD_OVERLAY_CLEAR: case BD_OVERLAY_CLEAR:
blurayClearOverlay(p_demux, overlay->plane); blurayClearOverlay(p_demux, overlay->plane);
break; break;
case BD_OVERLAY_FLUSH: case BD_OVERLAY_FLUSH:
blurayActivateOverlay(p_demux, overlay->plane); blurayActivateOverlay(p_demux, overlay->plane);
break; break;
case BD_OVERLAY_DRAW: case BD_OVERLAY_DRAW:
blurayDrawOverlay(p_demux, overlay); blurayDrawOverlay(p_demux, overlay);
break; break;
default: default:
msg_Warn(p_demux, "Unknown BD overlay command: %u", overlay->cmd); msg_Warn(p_demux, "Unknown BD overlay command: %u", overlay->cmd);
break; break;
} }
} }
...@@ -968,22 +969,22 @@ static void blurayArgbOverlayProc(void *ptr, const BD_ARGB_OVERLAY *const overla ...@@ -968,22 +969,22 @@ static void blurayArgbOverlayProc(void *ptr, const BD_ARGB_OVERLAY *const overla
demux_t *p_demux = (demux_t*)ptr; demux_t *p_demux = (demux_t*)ptr;
switch (overlay->cmd) { switch (overlay->cmd) {
case BD_ARGB_OVERLAY_INIT: case BD_ARGB_OVERLAY_INIT:
blurayInitArgbOverlay(p_demux, overlay->plane, overlay->w, overlay->h); blurayInitArgbOverlay(p_demux, overlay->plane, overlay->w, overlay->h);
break; break;
case BD_ARGB_OVERLAY_CLOSE: case BD_ARGB_OVERLAY_CLOSE:
blurayClearOverlay(p_demux, overlay->plane); blurayClearOverlay(p_demux, overlay->plane);
// TODO: blurayCloseOverlay(p_demux, overlay->plane); // TODO: blurayCloseOverlay(p_demux, overlay->plane);
break; break;
case BD_ARGB_OVERLAY_FLUSH: case BD_ARGB_OVERLAY_FLUSH:
blurayActivateOverlay(p_demux, overlay->plane); blurayActivateOverlay(p_demux, overlay->plane);
break; break;
case BD_ARGB_OVERLAY_DRAW: case BD_ARGB_OVERLAY_DRAW:
blurayDrawArgbOverlay(p_demux, overlay); blurayDrawArgbOverlay(p_demux, overlay);
break; break;
default: default:
msg_Warn(p_demux, "Unknown BD ARGB overlay command: %u", overlay->cmd); msg_Warn(p_demux, "Unknown BD ARGB overlay command: %u", overlay->cmd);
break; break;
} }
} }
...@@ -1059,10 +1060,11 @@ static void blurayResetParser( demux_t *p_demux ) ...@@ -1059,10 +1060,11 @@ static void blurayResetParser( demux_t *p_demux )
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
if (p_sys->p_parser) if (p_sys->p_parser)
stream_Delete(p_sys->p_parser); stream_Delete(p_sys->p_parser);
p_sys->p_parser = stream_DemuxNew(p_demux, "ts", p_sys->p_out); p_sys->p_parser = stream_DemuxNew(p_demux, "ts", p_sys->p_out);
if (!p_sys->p_parser) {
if (!p_sys->p_parser)
msg_Err(p_demux, "Failed to create TS demuxer"); msg_Err(p_demux, "Failed to create TS demuxer");
}
} }
static void blurayUpdateTitle(demux_t *p_demux, unsigned i_title) static void blurayUpdateTitle(demux_t *p_demux, unsigned i_title)
...@@ -1092,7 +1094,6 @@ static int bluraySetTitle(demux_t *p_demux, int i_title) ...@@ -1092,7 +1094,6 @@ static int bluraySetTitle(demux_t *p_demux, int i_title)
msg_Dbg( p_demux, "Selecting Title %i", i_title); msg_Dbg( p_demux, "Selecting Title %i", i_title);
/* Select Blu-Ray title */
if (bd_select_title(p_demux->p_sys->bluray, i_title) == 0 ) { if (bd_select_title(p_demux->p_sys->bluray, i_title) == 0 ) {
msg_Err(p_demux, "cannot select bd title '%d'", p_demux->info.i_title); msg_Err(p_demux, "cannot select bd title '%d'", p_demux->info.i_title);
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -1102,7 +1103,6 @@ static int bluraySetTitle(demux_t *p_demux, int i_title) ...@@ -1102,7 +1103,6 @@ static int bluraySetTitle(demux_t *p_demux, int i_title)
return VLC_SUCCESS; return VLC_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
* blurayControl: handle the controls * blurayControl: handle the controls
*****************************************************************************/ *****************************************************************************/
...@@ -1113,158 +1113,157 @@ static int blurayControl(demux_t *p_demux, int query, va_list args) ...@@ -1113,158 +1113,157 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
int64_t *pi_64; int64_t *pi_64;
switch (query) { switch (query) {
case DEMUX_CAN_SEEK: case DEMUX_CAN_SEEK:
case DEMUX_CAN_PAUSE: case DEMUX_CAN_PAUSE:
case DEMUX_CAN_CONTROL_PACE: case DEMUX_CAN_CONTROL_PACE:
pb_bool = (bool*)va_arg( args, bool * ); pb_bool = (bool*)va_arg( args, bool * );
*pb_bool = true; *pb_bool = true;
break; break;
case DEMUX_GET_PTS_DELAY: case DEMUX_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * ); pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = *pi_64 = INT64_C(1000) * var_InheritInteger(p_demux, "disc-caching");
INT64_C(1000) * var_InheritInteger( p_demux, "disc-caching" ); break;
break;
case DEMUX_SET_PAUSE_STATE:
case DEMUX_SET_PAUSE_STATE: /* Nothing to do */
/* Nothing to do */ break;
break;
case DEMUX_SET_TITLE:
case DEMUX_SET_TITLE: {
{ int i_title = (int)va_arg( args, int );
int i_title = (int)va_arg( args, int ); if (bluraySetTitle(p_demux, i_title) != VLC_SUCCESS)
if (bluraySetTitle(p_demux, i_title) != VLC_SUCCESS) return VLC_EGENERIC;
return VLC_EGENERIC; break;
break; }
} case DEMUX_SET_SEEKPOINT:
case DEMUX_SET_SEEKPOINT: {
{ int i_chapter = (int)va_arg( args, int );
int i_chapter = (int)va_arg( args, int ); bd_seek_chapter( p_sys->bluray, i_chapter );
bd_seek_chapter( p_sys->bluray, i_chapter ); p_demux->info.i_update = INPUT_UPDATE_SEEKPOINT;
p_demux->info.i_update = INPUT_UPDATE_SEEKPOINT; break;
break; }
}
case DEMUX_GET_TITLE_INFO: case DEMUX_GET_TITLE_INFO:
{ {
input_title_t ***ppp_title = (input_title_t***)va_arg( args, input_title_t*** ); input_title_t ***ppp_title = (input_title_t***)va_arg( args, input_title_t*** );
int *pi_int = (int*)va_arg( args, int* ); int *pi_int = (int*)va_arg( args, int* );
int *pi_title_offset = (int*)va_arg( args, int* ); int *pi_title_offset = (int*)va_arg( args, int* );
int *pi_chapter_offset = (int*)va_arg( args, int* ); int *pi_chapter_offset = (int*)va_arg( args, int* );
/* */ /* */
*pi_title_offset = 0; *pi_title_offset = 0;
*pi_chapter_offset = 0; *pi_chapter_offset = 0;
/* Duplicate local title infos */ /* Duplicate local title infos */
*pi_int = p_sys->i_title; *pi_int = p_sys->i_title;
*ppp_title = calloc( p_sys->i_title, sizeof(input_title_t **) ); *ppp_title = malloc(p_sys->i_title * sizeof(input_title_t **));
for( unsigned int i = 0; i < p_sys->i_title; i++ ) for (unsigned int i = 0; i < p_sys->i_title; i++)
(*ppp_title)[i] = vlc_input_title_Duplicate( p_sys->pp_title[i]); (*ppp_title)[i] = vlc_input_title_Duplicate(p_sys->pp_title[i]);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case DEMUX_GET_LENGTH: case DEMUX_GET_LENGTH:
{ {
int64_t *pi_length = (int64_t*)va_arg(args, int64_t *); int64_t *pi_length = (int64_t*)va_arg(args, int64_t *);
*pi_length = p_demux->info.i_title < (int)p_sys->i_title ? CUR_LENGTH : 0; *pi_length = p_demux->info.i_title < (int)p_sys->i_title ? CUR_LENGTH : 0;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case DEMUX_SET_TIME: case DEMUX_SET_TIME:
{ {
int64_t i_time = (int64_t)va_arg(args, int64_t); int64_t i_time = (int64_t)va_arg(args, int64_t);
bd_seek_time(p_sys->bluray, TO_TICKS(i_time)); bd_seek_time(p_sys->bluray, TO_TICKS(i_time));
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case DEMUX_GET_TIME: case DEMUX_GET_TIME:
{ {
int64_t *pi_time = (int64_t*)va_arg(args, int64_t *); int64_t *pi_time = (int64_t*)va_arg(args, int64_t *);
*pi_time = (int64_t)FROM_TICKS(bd_tell_time(p_sys->bluray)); *pi_time = (int64_t)FROM_TICKS(bd_tell_time(p_sys->bluray));
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case DEMUX_GET_POSITION: case DEMUX_GET_POSITION:
{ {
double *pf_position = (double*)va_arg( args, double * ); double *pf_position = (double*)va_arg( args, double * );
*pf_position = p_demux->info.i_title < (int)p_sys->i_title ? *pf_position = p_demux->info.i_title < (int)p_sys->i_title ?
(double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH : 0.0; (double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH : 0.0;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case DEMUX_SET_POSITION: case DEMUX_SET_POSITION:
{ {
double f_position = (double)va_arg(args, double); double f_position = (double)va_arg(args, double);
bd_seek_time(p_sys->bluray, TO_TICKS(f_position*CUR_LENGTH)); bd_seek_time(p_sys->bluray, TO_TICKS(f_position*CUR_LENGTH));
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case DEMUX_GET_META: case DEMUX_GET_META:
{ {
vlc_meta_t *p_meta = (vlc_meta_t *) va_arg (args, vlc_meta_t*); vlc_meta_t *p_meta = (vlc_meta_t *) va_arg (args, vlc_meta_t*);
const META_DL *meta = p_sys->p_meta; const META_DL *meta = p_sys->p_meta;
if (meta == NULL) if (meta == NULL)
return VLC_EGENERIC; return VLC_EGENERIC;
if (!EMPTY_STR(meta->di_name)) vlc_meta_SetTitle(p_meta, meta->di_name); if (!EMPTY_STR(meta->di_name)) vlc_meta_SetTitle(p_meta, meta->di_name);
if (!EMPTY_STR(meta->language_code)) vlc_meta_AddExtra(p_meta, "Language", meta->language_code); if (!EMPTY_STR(meta->language_code)) vlc_meta_AddExtra(p_meta, "Language", meta->language_code);
if (!EMPTY_STR(meta->filename)) vlc_meta_AddExtra(p_meta, "Filename", meta->filename); if (!EMPTY_STR(meta->filename)) vlc_meta_AddExtra(p_meta, "Filename", meta->filename);
if (!EMPTY_STR(meta->di_alternative)) vlc_meta_AddExtra(p_meta, "Alternative", meta->di_alternative); if (!EMPTY_STR(meta->di_alternative)) vlc_meta_AddExtra(p_meta, "Alternative", meta->di_alternative);
// if (meta->di_set_number > 0) vlc_meta_SetTrackNum(p_meta, meta->di_set_number); // if (meta->di_set_number > 0) vlc_meta_SetTrackNum(p_meta, meta->di_set_number);
// if (meta->di_num_sets > 0) vlc_meta_AddExtra(p_meta, "Discs numbers in Set", meta->di_num_sets); // if (meta->di_num_sets > 0) vlc_meta_AddExtra(p_meta, "Discs numbers in Set", meta->di_num_sets);
if (meta->thumb_count > 0 && meta->thumbnails) if (meta->thumb_count > 0 && meta->thumbnails)
{
char *psz_thumbpath;
if( asprintf( &psz_thumbpath, "%s" DIR_SEP "BDMV" DIR_SEP "META" DIR_SEP "DL" DIR_SEP "%s",
p_sys->psz_bd_path, meta->thumbnails[0].path ) > 0 )
{ {
char *psz_thumbpath; char *psz_thumburl = vlc_path2uri( psz_thumbpath, "file" );
if( asprintf( &psz_thumbpath, "%s" DIR_SEP "BDMV" DIR_SEP "META" DIR_SEP "DL" DIR_SEP "%s", if( unlikely(psz_thumburl == NULL) )
p_sys->psz_bd_path, meta->thumbnails[0].path ) > 0 ) return VLC_ENOMEM;
{
char *psz_thumburl = vlc_path2uri( psz_thumbpath, "file" );
if( unlikely(psz_thumburl == NULL) )
return VLC_ENOMEM;
vlc_meta_SetArtURL( p_meta, psz_thumburl );
free( psz_thumburl );
}
free( psz_thumbpath );
}
return VLC_SUCCESS; vlc_meta_SetArtURL( p_meta, psz_thumburl );
free( psz_thumburl );
}
free( psz_thumbpath );
} }
case DEMUX_NAV_ACTIVATE: return VLC_SUCCESS;
return sendKeyEvent(p_sys, BD_VK_ENTER); }
case DEMUX_NAV_UP:
return sendKeyEvent(p_sys, BD_VK_UP); case DEMUX_NAV_ACTIVATE:
case DEMUX_NAV_DOWN: return sendKeyEvent(p_sys, BD_VK_ENTER);
return sendKeyEvent(p_sys, BD_VK_DOWN); case DEMUX_NAV_UP:
case DEMUX_NAV_LEFT: return sendKeyEvent(p_sys, BD_VK_UP);
return sendKeyEvent(p_sys, BD_VK_LEFT); case DEMUX_NAV_DOWN:
case DEMUX_NAV_RIGHT: return sendKeyEvent(p_sys, BD_VK_DOWN);
return sendKeyEvent(p_sys, BD_VK_RIGHT); case DEMUX_NAV_LEFT:
return sendKeyEvent(p_sys, BD_VK_LEFT);
case DEMUX_CAN_RECORD: case DEMUX_NAV_RIGHT:
case DEMUX_GET_FPS: return sendKeyEvent(p_sys, BD_VK_RIGHT);
case DEMUX_SET_GROUP:
case DEMUX_HAS_UNSUPPORTED_META: case DEMUX_CAN_RECORD:
case DEMUX_GET_ATTACHMENTS: case DEMUX_GET_FPS:
return VLC_EGENERIC; case DEMUX_SET_GROUP:
default: case DEMUX_HAS_UNSUPPORTED_META:
msg_Warn( p_demux, "unimplemented query (%d) in control", query ); case DEMUX_GET_ATTACHMENTS:
return VLC_EGENERIC; return VLC_EGENERIC;
default:
msg_Warn( p_demux, "unimplemented query (%d) in control", query );
return VLC_EGENERIC;
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static void blurayUpdateCurrentClip( demux_t *p_demux, uint32_t clip ) static void blurayUpdateCurrentClip( demux_t *p_demux, uint32_t clip )
{ {
if (clip == 0xFF) if (clip == 0xFF)
return ; return ;
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
p_sys->i_current_clip = clip; p_sys->i_current_clip = clip;
BLURAY_TITLE_INFO *info = bd_get_title_info(p_sys->bluray, BLURAY_TITLE_INFO *info = bd_get_title_info(p_sys->bluray,
bd_get_current_title(p_sys->bluray), 0); bd_get_current_title(p_sys->bluray), 0);
if ( info == NULL ) if ( info == NULL )
return ; return ;
...@@ -1278,44 +1277,42 @@ static void blurayUpdateCurrentClip( demux_t *p_demux, uint32_t clip ) ...@@ -1278,44 +1277,42 @@ static void blurayUpdateCurrentClip( demux_t *p_demux, uint32_t clip )
static void blurayHandleEvent( demux_t *p_demux, const BD_EVENT *e ) static void blurayHandleEvent( demux_t *p_demux, const BD_EVENT *e )
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
switch (e->event) switch (e->event)
{ {
case BD_EVENT_TITLE: case BD_EVENT_TITLE:
blurayUpdateTitle(p_demux, e->param); blurayUpdateTitle(p_demux, e->param);
break; break;
case BD_EVENT_PLAYITEM: case BD_EVENT_PLAYITEM:
blurayUpdateCurrentClip(p_demux, e->param); blurayUpdateCurrentClip(p_demux, e->param);
break; break;
case BD_EVENT_AUDIO_STREAM: case BD_EVENT_AUDIO_STREAM:
{ if ( e->param == 0xFF )
if ( e->param == 0xFF )
break ;
BLURAY_TITLE_INFO *info = bd_get_title_info(p_sys->bluray,
bd_get_current_title(p_sys->bluray), 0);
if ( info == NULL )
break ;
/* The param we get is the real stream id, not an index, ie. it starts from 1 */
int pid = info->clips[p_sys->i_current_clip].audio_streams[e->param - 1].pid;
int idx = findEsPairIndex( p_sys, pid );
if ( idx >= 0 ) {
es_out_id_t *p_es = vlc_array_item_at_index(&p_sys->es, idx);
es_out_Control( p_demux->out, ES_OUT_SET_ES, p_es );
}
bd_free_title_info( info );
p_sys->i_audio_stream = pid;
break ; break ;
BLURAY_TITLE_INFO *info = bd_get_title_info(p_sys->bluray,
bd_get_current_title(p_sys->bluray), 0);
if (info == NULL)
break ;
/* The param we get is the real stream id, not an index, ie. it starts from 1 */
int pid = info->clips[p_sys->i_current_clip].audio_streams[e->param - 1].pid;
int idx = findEsPairIndex(p_sys, pid);
if (idx >= 0) {
es_out_id_t *p_es = vlc_array_item_at_index(&p_sys->es, idx);
es_out_Control( p_demux->out, ES_OUT_SET_ES, p_es );
} }
case BD_EVENT_CHAPTER: bd_free_title_info( info );
p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT; p_sys->i_audio_stream = pid;
p_demux->info.i_seekpoint = e->param; break ;
break; case BD_EVENT_CHAPTER: