Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
cefad26a
Commit
cefad26a
authored
Aug 03, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/access/dvd*.c: implemented DEMUX_GET_TIME/DEMUX_GET_LENGTH based on the MPEG mux rate.
parent
fb820b48
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
23 deletions
+63
-23
modules/access/dvdnav.c
modules/access/dvdnav.c
+38
-17
modules/access/dvdread.c
modules/access/dvdread.c
+25
-6
No files found.
modules/access/dvdnav.c
View file @
cefad26a
...
...
@@ -39,7 +39,7 @@
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define CACHING_TEXT N_("
c
aching value in ms")
#define CACHING_TEXT N_("
C
aching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for DVDnav streams. This "\
"value should be set in millisecond units." )
...
...
@@ -90,6 +90,7 @@ struct demux_sys_t
/* track */
ps_track_t
tk
[
PS_TK_COUNT
];
int
i_mux_rate
;
/* for spu variables */
input_thread_t
*
p_input
;
...
...
@@ -165,6 +166,7 @@ static int Open( vlc_object_t *p_this )
ps_track_init
(
p_sys
->
tk
);
p_sys
->
i_aspect
=
-
1
;
p_sys
->
b_es_out_ok
=
VLC_FALSE
;
p_sys
->
i_mux_rate
=
0
;
if
(
1
)
{
...
...
@@ -320,28 +322,27 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
switch
(
i_query
)
{
case
DEMUX_SET_POSITION
:
case
DEMUX_GET_POSITION
:
case
DEMUX_GET_TIME
:
case
DEMUX_GET_LENGTH
:
{
uint32_t
pos
,
len
;
pf
=
(
double
*
)
va_arg
(
args
,
double
*
);
if
(
dvdnav_get_position
(
p_sys
->
dvdnav
,
&
pos
,
&
len
)
==
DVDNAV_STATUS_OK
&&
len
>
0
)
if
(
dvdnav_get_position
(
p_sys
->
dvdnav
,
&
pos
,
&
len
)
!=
DVDNAV_STATUS_OK
||
len
==
0
)
{
*
pf
=
(
double
)
pos
/
(
double
)
len
;
return
VLC_EGENERIC
;
}
else
if
(
i_query
==
DEMUX_GET_POSITION
)
{
*
pf
=
0
.
0
;
}
pf
=
(
double
*
)
va_arg
(
args
,
double
*
)
;
*
pf
=
(
double
)
pos
/
(
double
)
len
;
return
VLC_SUCCESS
;
}
case
DEMUX_SET_POSITION
:
else
if
(
i_query
==
DEMUX_SET_POSITION
)
{
uint32_t
pos
,
len
;
f
=
(
double
)
va_arg
(
args
,
double
);
if
(
dvdnav_get_position
(
p_sys
->
dvdnav
,
&
pos
,
&
len
)
==
DVDNAV_STATUS_OK
&&
len
>
0
)
{
pos
=
f
*
len
;
if
(
dvdnav_sector_search
(
p_sys
->
dvdnav
,
pos
,
SEEK_SET
)
==
DVDNAV_STATUS_OK
)
...
...
@@ -349,6 +350,26 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return
VLC_SUCCESS
;
}
}
else
if
(
i_query
==
DEMUX_GET_TIME
)
{
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
i_mux_rate
>
0
)
{
*
pi64
=
(
int64_t
)
1000000
*
2048
*
pos
/
50
/
p_sys
->
i_mux_rate
;
return
VLC_SUCCESS
;
}
}
else
if
(
i_query
==
DEMUX_GET_LENGTH
)
{
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
i_mux_rate
>
0
)
{
*
pi64
=
(
int64_t
)
1000000
*
len
*
2048
/
50
/
p_sys
->
i_mux_rate
;
return
VLC_SUCCESS
;
}
}
return
VLC_EGENERIC
;
}
...
...
@@ -986,6 +1007,7 @@ static int DemuxBlock( demux_t *p_demux, uint8_t *pkt, int i_pkt )
if
(
!
ps_pkt_parse_pack
(
p_pkt
,
&
i_scr
,
&
i_mux_rate
)
)
{
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
i_scr
);
if
(
i_mux_rate
>
0
)
p_sys
->
i_mux_rate
=
i_mux_rate
;
}
block_Release
(
p_pkt
);
break
;
...
...
@@ -1142,7 +1164,6 @@ static int EventThread( vlc_object_t *p_this )
p_ev
->
b_moved
=
VLC_FALSE
;
p_ev
->
b_clicked
=
VLC_FALSE
;
p_ev
->
b_key
=
VLC_FALSE
;
p_ev
->
b_still
=
VLC_FALSE
;
/* catch all key event */
...
...
modules/access/dvdread.c
View file @
cefad26a
...
...
@@ -54,7 +54,7 @@
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define CACHING_TEXT N_("
c
aching value in ms")
#define CACHING_TEXT N_("
C
aching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for DVDread streams. " \
"This value should be set in millisecond units." )
...
...
@@ -138,6 +138,7 @@ struct demux_sys_t
/* Track */
ps_track_t
tk
[
PS_TK_COUNT
];
int
i_mux_rate
;
int
i_titles
;
input_title_t
**
titles
;
...
...
@@ -230,6 +231,7 @@ static int Open( vlc_object_t *p_this )
ps_track_init
(
p_sys
->
tk
);
p_sys
->
i_aspect
=
-
1
;
p_sys
->
i_mux_rate
=
0
;
p_sys
->
p_dvdread
=
p_dvdread
;
p_sys
->
p_vmg_file
=
p_vmg_file
;
...
...
@@ -312,6 +314,27 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return
VLC_SUCCESS
;
}
case
DEMUX_GET_TIME
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
i_mux_rate
>
0
)
{
*
pi64
=
(
int64_t
)
1000000
*
DVD_VIDEO_LB_LEN
*
p_sys
->
i_title_offset
/
50
/
p_sys
->
i_mux_rate
;
return
VLC_SUCCESS
;
}
*
pi64
=
0
;
return
VLC_EGENERIC
;
case
DEMUX_GET_LENGTH
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
i_mux_rate
>
0
)
{
*
pi64
=
(
int64_t
)
1000000
*
DVD_VIDEO_LB_LEN
*
p_sys
->
i_title_blocks
/
50
/
p_sys
->
i_mux_rate
;
return
VLC_SUCCESS
;
}
*
pi64
=
0
;
return
VLC_EGENERIC
;
/* Special for access_demux */
case
DEMUX_CAN_PAUSE
:
...
...
@@ -519,6 +542,7 @@ static int DemuxBlock( demux_t *p_demux, uint8_t *pkt, int i_pkt )
if
(
!
ps_pkt_parse_pack
(
p_pkt
,
&
i_scr
,
&
i_mux_rate
)
)
{
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
i_scr
);
if
(
i_mux_rate
>
0
)
p_sys
->
i_mux_rate
=
i_mux_rate
;
}
block_Release
(
p_pkt
);
break
;
...
...
@@ -1126,10 +1150,6 @@ static void DvdReadFindCell( demux_t *p_demux )
if
(
cell
[
p_sys
->
i_cur_cell
].
block_type
==
BLOCK_TYPE_ANGLE_BLOCK
)
{
#if 0
p_sys->i_next_cell = p_sys->i_cur_cell + p_sys->i_angle_nb;
p_sys->i_cur_cell += p_sys->i_angle - 1;
#else
p_sys
->
i_cur_cell
+=
p_sys
->
i_angle
-
1
;
while
(
cell
[
p_sys
->
i_cur_cell
+
i
].
block_mode
!=
BLOCK_MODE_LAST_CELL
)
...
...
@@ -1137,7 +1157,6 @@ static void DvdReadFindCell( demux_t *p_demux )
i
++
;
}
p_sys
->
i_next_cell
=
p_sys
->
i_cur_cell
+
i
+
1
;
#endif
}
else
{
...
...
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