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
331625d9
Commit
331625d9
authored
May 07, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved date_Decrement to libvlc core from dirac.
parent
fc44328d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
include/vlc_mtime.h
include/vlc_mtime.h
+1
-0
modules/packetizer/dirac.c
modules/packetizer/dirac.c
+0
-20
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/mtime.c
src/misc/mtime.c
+27
-0
No files found.
include/vlc_mtime.h
View file @
331625d9
...
...
@@ -136,5 +136,6 @@ VLC_EXPORT( void, date_Set, ( date_t *, mtime_t ) );
VLC_EXPORT
(
mtime_t
,
date_Get
,
(
const
date_t
*
)
);
VLC_EXPORT
(
void
,
date_Move
,
(
date_t
*
,
mtime_t
)
);
VLC_EXPORT
(
mtime_t
,
date_Increment
,
(
date_t
*
,
uint32_t
)
);
VLC_EXPORT
(
mtime_t
,
date_Decrement
,
(
date_t
*
,
uint32_t
)
);
VLC_EXPORT
(
uint64_t
,
NTPtime64
,
(
void
)
);
#endif
/* !__VLC_MTIME_ */
modules/packetizer/dirac.c
View file @
331625d9
...
...
@@ -266,26 +266,6 @@ static dirac_block_encap_t *dirac_GetBlockEncap( block_t *p_block )
* General utility funcions
*/
/* decrement a date. opposite to date_Increment */
static
mtime_t
date_Decrement
(
date_t
*
p_date
,
uint32_t
i_nb_samples
)
{
mtime_t
i_dividend
=
(
mtime_t
)
i_nb_samples
*
1000000
*
p_date
->
i_divider_den
;
p_date
->
date
-=
i_dividend
/
p_date
->
i_divider_num
;
unsigned
u_rem_adjust
=
i_dividend
%
p_date
->
i_divider_num
;
if
(
p_date
->
i_remainder
<
u_rem_adjust
)
{
/* This is Bresenham algorithm. */
assert
(
p_date
->
i_remainder
>
-
p_date
->
i_divider_num
);
p_date
->
date
-=
1
;
p_date
->
i_remainder
+=
p_date
->
i_divider_num
;
}
p_date
->
i_remainder
-=
u_rem_adjust
;
return
p_date
->
date
;
}
/**
* given a chain of block_t, allocate and return an array containing
* pointers to all the blocks. (Acts as a replacement for the old p_prev
...
...
src/libvlccore.sym
View file @
331625d9
...
...
@@ -74,6 +74,7 @@ config_StringEscape
config_StringUnescape
convert_xml_special_chars
date_Change
date_Decrement
date_Get
date_Increment
date_Init
...
...
src/misc/mtime.c
View file @
331625d9
...
...
@@ -536,6 +536,33 @@ mtime_t date_Increment( date_t *p_date, uint32_t i_nb_samples )
return
p_date
->
date
;
}
/**
* Decrement the date and return the result, taking into account
* rounding errors.
*
* \param date to decrement
* \param decrementation in number of samples
* \return date value
*/
mtime_t
date_Decrement
(
date_t
*
p_date
,
uint32_t
i_nb_samples
)
{
mtime_t
i_dividend
=
(
mtime_t
)
i_nb_samples
*
1000000
*
p_date
->
i_divider_den
;
p_date
->
date
-=
i_dividend
/
p_date
->
i_divider_num
;
unsigned
i_rem_adjust
=
i_dividend
%
p_date
->
i_divider_num
;
if
(
p_date
->
i_remainder
<
i_rem_adjust
)
{
/* This is Bresenham algorithm. */
assert
(
p_date
->
i_remainder
>
-
p_date
->
i_divider_num
);
p_date
->
date
-=
1
;
p_date
->
i_remainder
+=
p_date
->
i_divider_num
;
}
p_date
->
i_remainder
-=
i_rem_adjust
;
return
p_date
->
date
;
}
#ifndef HAVE_GETTIMEOFDAY
#ifdef WIN32
...
...
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