Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
17f7243a
Commit
17f7243a
authored
Mar 08, 2012
by
Hugo Beauzée-Luyssen
Committed by
Jean-Baptiste Kempf
Mar 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bluray: Prepare menu handling
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
091a4267
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
16 deletions
+52
-16
modules/access/bluray.c
modules/access/bluray.c
+52
-16
No files found.
modules/access/bluray.c
View file @
17f7243a
...
...
@@ -44,6 +44,10 @@
* Module descriptor
*****************************************************************************/
#define BD_MENU_TEXT N_( "Bluray menus" )
#define BD_MENU_LONGTEXT N_( "Use bluray menus. If disabled, "\
"the movie will start directly" )
/* Callbacks */
static
int
blurayOpen
(
vlc_object_t
*
);
static
void
blurayClose
(
vlc_object_t
*
);
...
...
@@ -55,6 +59,7 @@ vlc_module_begin ()
set_category
(
CAT_INPUT
)
set_subcategory
(
SUBCAT_INPUT_ACCESS
)
set_capability
(
"access_demux"
,
200
)
add_bool
(
"bluray-menu"
,
false
,
BD_MENU_TEXT
,
BD_MENU_LONGTEXT
,
false
)
add_shortcut
(
"bluray"
,
"file"
)
...
...
@@ -71,6 +76,9 @@ struct demux_sys_t
unsigned
int
i_longest_title
;
input_title_t
**
pp_title
;
/* Menus */
bool
b_menu
;
/* TS stream */
stream_t
*
p_parser
;
};
...
...
@@ -79,7 +87,7 @@ struct demux_sys_t
* Local prototypes
*****************************************************************************/
static
int
blurayControl
(
demux_t
*
,
int
,
va_list
);
static
int
blurayDemux
(
demux_t
*
);
static
int
blurayDemux
(
demux_t
*
);
static
int
blurayInitTitles
(
demux_t
*
p_demux
);
static
int
bluraySetTitle
(
demux_t
*
p_demux
,
int
i_title
);
...
...
@@ -198,17 +206,29 @@ static int blurayOpen( vlc_object_t *object )
*/
bd_get_event
(
p_sys
->
bluray
,
NULL
);
/* get title request */
if
((
pos_title
=
strrchr
(
bd_path
,
':'
)))
{
/* found character ':' for title information */
*
(
pos_title
++
)
=
'\0'
;
i_title
=
atoi
(
pos_title
);
p_sys
->
b_menu
=
var_InheritBool
(
p_demux
,
"bluray-menu"
);
if
(
p_sys
->
b_menu
)
{
/*
* libbluray will start playback from "First-Title" title
* Therefore, We don't have to select any title.
*/
bd_play
(
p_sys
->
bluray
);
}
else
{
/* get title request */
if
((
pos_title
=
strrchr
(
bd_path
,
':'
)))
{
/* found character ':' for title information */
*
(
pos_title
++
)
=
'\0'
;
i_title
=
atoi
(
pos_title
);
}
/* set start title number */
if
(
bluraySetTitle
(
p_demux
,
i_title
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_demux
,
"Could not set the title %d"
,
i_title
);
goto
error
;
/* set start title number */
if
(
bluraySetTitle
(
p_demux
,
i_title
)
!=
VLC_SUCCESS
)
{
msg_Err
(
p_demux
,
"Could not set the title %d"
,
i_title
);
goto
error
;
}
}
p_sys
->
p_parser
=
stream_DemuxNew
(
p_demux
,
"ts"
,
p_demux
->
out
);
...
...
@@ -504,12 +524,28 @@ static int blurayDemux(demux_t *p_demux)
return
-
1
;
}
blurayHandleEvents
(
p_demux
);
int
nread
=
bd_read
(
p_sys
->
bluray
,
p_block
->
p_buffer
,
NB_TS_PACKETS
*
BD_TS_PACKET_SIZE
);
if
(
nread
<
0
)
{
block_Release
(
p_block
);
return
nread
;
int
nread
=
-
1
;
if
(
p_sys
->
b_menu
==
false
)
{
blurayHandleEvents
(
p_demux
);
nread
=
bd_read
(
p_sys
->
bluray
,
p_block
->
p_buffer
,
NB_TS_PACKETS
*
BD_TS_PACKET_SIZE
);
if
(
nread
<
0
)
{
block_Release
(
p_block
);
return
nread
;
}
}
else
{
BD_EVENT
e
;
nread
=
bd_read_ext
(
p_sys
->
bluray
,
p_block
->
p_buffer
,
NB_TS_PACKETS
*
BD_TS_PACKET_SIZE
,
&
e
);
if
(
nread
==
0
)
{
if
(
e
.
event
==
BD_EVENT_NONE
)
msg_Info
(
p_demux
,
"We reached the end of a title"
);
else
blurayHandleEvent
(
p_demux
,
&
e
);
block_Release
(
p_block
);
return
1
;
}
}
p_block
->
i_buffer
=
nread
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment