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
286a9420
Commit
286a9420
authored
Mar 05, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvdread.c: fix the title duration & time reports
parent
d2a821e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
4 deletions
+42
-4
modules/access/dvdread.c
modules/access/dvdread.c
+42
-4
No files found.
modules/access/dvdread.c
View file @
286a9420
...
...
@@ -300,6 +300,44 @@ static void Close( vlc_object_t *p_this )
free
(
p_sys
);
}
static
int64_t
dvdtime_to_time
(
dvd_time_t
*
dtime
,
uint8_t
still_time
)
{
/* Macro to convert Binary Coded Decimal to Decimal */
#define BCD2D(__x__) (((__x__ & 0xf0) >> 4) * 10 + (__x__ & 0x0f))
double
f_fps
,
f_ms
;
int64_t
i_micro_second
=
0
;
if
(
still_time
==
0
||
still_time
==
0xFF
)
{
i_micro_second
+=
(
int64_t
)(
BCD2D
(
dtime
->
hour
))
*
60
*
60
*
1000000
;
i_micro_second
+=
(
int64_t
)(
BCD2D
(
dtime
->
minute
))
*
60
*
1000000
;
i_micro_second
+=
(
int64_t
)(
BCD2D
(
dtime
->
second
))
*
1000000
;
switch
((
dtime
->
frame_u
&
0xc0
)
>>
6
)
{
case
1
:
f_fps
=
25
.
0
;
break
;
case
3
:
f_fps
=
29
.
97
;
break
;
default:
f_fps
=
2500
.
0
;
break
;
}
f_ms
=
BCD2D
(
dtime
->
frame_u
&
0x3f
)
*
1000
.
0
/
f_fps
;
i_micro_second
+=
(
int64_t
)(
f_ms
*
1000
.
0
);
}
else
{
i_micro_second
=
still_time
;
i_micro_second
=
(
int64_t
)((
double
)
i_micro_second
*
1000000
.
0
);
}
return
i_micro_second
;
}
/*****************************************************************************
* Control:
*****************************************************************************/
...
...
@@ -347,10 +385,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
case
DEMUX_GET_LENGTH
:
pi64
=
(
int64_t
*
)
va_arg
(
args
,
int64_t
*
);
if
(
p_sys
->
i_mux_rate
>
0
)
if
(
p_demux
->
info
.
i_title
>=
0
&&
p_demux
->
info
.
i_title
<
p_sys
->
i_titles
)
{
*
pi64
=
(
int64_t
)
1000000
*
DVD_VIDEO_LB_LEN
*
p_sys
->
i_title_blocks
/
50
/
p_sys
->
i_mux_rate
;
*
pi64
=
dvdtime_to_time
(
&
p_sys
->
p_cur_pgc
->
playback_time
,
0
);
p_sys
->
i_mux_rate
=
p_sys
->
i_title_blocks
*
DVD_VIDEO_LB_LEN
/
(
*
pi64
/
20000
)
;
return
VLC_SUCCESS
;
}
*
pi64
=
0
;
...
...
@@ -571,7 +609,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
;
/* if( i_mux_rate > 0 ) p_sys->i_mux_rate = i_mux_rate;*/
}
block_Release
(
p_pkt
);
break
;
...
...
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