Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
3807a5ed
Commit
3807a5ed
authored
Sep 23, 1999
by
Jean-Marc Dressler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Impl�mentation rudimentaire de la synchro : les packets
PES sont maintenant dat�s. -- Polux
parent
803556c3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
8 deletions
+34
-8
include/input.h
include/input.h
+2
-1
src/input/input.c
src/input/input.c
+27
-6
src/input/input_pcr.c
src/input/input_pcr.c
+5
-1
No files found.
include/input.h
View file @
3807a5ed
...
...
@@ -203,7 +203,6 @@ typedef struct
* pcr_descriptor_t
*******************************************************************************
* Contains informations used to synchronise the decoder with the server
* Only input_PcrDecode() is allowed to modify it
*******************************************************************************/
typedef
struct
pcr_descriptor_struct
...
...
@@ -211,9 +210,11 @@ typedef struct pcr_descriptor_struct
pthread_mutex_t
lock
;
/* pcr modification lock */
s64
delta_clock
;
s64
delta_decode
;
/* represents decoder_time - pcr_time in usecondes */
count_t
c_average
;
/* counter used to compute dynamic average values */
count_t
c_pts
;
#ifdef STATS
/* Stats */
count_t
c_average_jitter
;
...
...
src/input/input.c
View file @
3807a5ed
...
...
@@ -870,12 +870,33 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
the 14 bytes */
if
(
p_pes
->
b_has_pts
)
{
pcr_descriptor_t
*
p_pcr
;
/* The PTS field is split in 3 bit records. We have to add
them, and thereafter we substract the 2 marker_bits */
p_pes
->
i_pts
=
(
(
p_pes
->
p_pes_header
[
9
]
<<
29
)
+
(
U16_AT
(
p_pes
->
p_pes_header
+
10
)
<<
14
)
+
(
U16_AT
(
p_pes
->
p_pes_header
+
12
)
>>
1
)
-
p_pcr
=
p_input
->
p_pcr
;
pthread_mutex_lock
(
&
p_pcr
->
lock
);
if
(
p_pcr
->
delta_clock
==
0
)
{
p_pes
->
i_pts
=
0
;
}
else
{
p_pes
->
i_pts
=
(
((
s64
)
p_pes
->
p_pes_header
[
9
]
<<
29
)
+
((
s64
)
U16_AT
(
p_pes
->
p_pes_header
+
10
)
<<
14
)
+
((
s64
)
U16_AT
(
p_pes
->
p_pes_header
+
12
)
>>
1
)
-
(
1
<<
14
)
-
(
1
<<
29
)
);
p_pes
->
i_pts
*=
300
;
p_pes
->
i_pts
/=
27
;
p_pes
->
i_pts
+=
p_pcr
->
delta_clock
;
if
(
p_pcr
->
c_pts
==
0
)
{
p_pcr
->
delta_decode
=
mdate
()
-
p_pes
->
i_pts
+
500000
;
}
p_pes
->
i_pts
+=
p_pcr
->
delta_decode
;
}
p_pcr
->
c_pts
+=
1
;
pthread_mutex_unlock
(
&
p_pcr
->
lock
);
}
break
;
}
...
...
src/input/input_pcr.c
View file @
3807a5ed
...
...
@@ -30,9 +30,12 @@ void input_PcrReInit( input_thread_t *p_input )
pcr_descriptor_t
*
p_pcr
;
ASSERT
(
p_input
);
p
_pcr
=
p_input
->
p_pcr
;
p
thread_mutex_lock
(
&
p_pcr
->
lock
)
;
p_pcr
=
p_input
->
p_pcr
;
p_pcr
->
delta_clock
=
0
;
p_pcr
->
c_average
=
0
;
p_pcr
->
c_pts
=
0
;
#ifdef STATS
p_pcr
->
c_average_jitter
=
0
;
...
...
@@ -42,6 +45,7 @@ void input_PcrReInit( input_thread_t *p_input )
/* For the printf in input_PcrDecode(), this is used for debug purpose only */
printf
(
"
\n
"
);
#endif
pthread_mutex_unlock
(
&
p_pcr
->
lock
);
}
/******************************************************************************
...
...
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