Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
cf61649a
Commit
cf61649a
authored
Dec 20, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used VLC_TS_INVALID/0 in ty demuxer.
parent
0e0065f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
modules/demux/ty.c
modules/demux/ty.c
+14
-12
No files found.
modules/demux/ty.c
View file @
cf61649a
...
...
@@ -331,6 +331,8 @@ static int Open(vlc_object_t *p_this)
p_sys
->
b_first_chunk
=
true
;
p_sys
->
b_have_master
=
(
U32_AT
(
p_peek
)
==
TIVO_PES_FILEID
);
p_sys
->
firstAudioPTS
=
-
1
;
p_sys
->
lastAudioPTS
=
VLC_TS_INVALID
;
p_sys
->
lastVideoPTS
=
VLC_TS_INVALID
;
p_sys
->
i_stream_size
=
stream_Size
(
p_demux
->
s
);
p_sys
->
tivo_type
=
TIVO_TYPE_UNKNOWN
;
p_sys
->
audio_type
=
TIVO_AUDIO_UNKNOWN
;
...
...
@@ -441,7 +443,7 @@ static int Demux( demux_t *p_demux )
/* set these as 'unknown' for now */
p_block_in
->
i_pts
=
p_block_in
->
i_dts
=
0
;
p_block_in
->
i_dts
=
VLC_TS_INVALID
;
}
/*else
{
...
...
@@ -628,8 +630,8 @@ static int check_sync_pes( demux_t *p_demux, block_t *p_block,
return
-
1
;
/* partial PES, no audio data */
}
/* full PES header present, extract PTS */
p_sys
->
lastAudioPTS
=
get_pts
(
&
p_block
->
p_buffer
[
offset
+
p_sys
->
i_Pts_Offset
]
);
p_sys
->
lastAudioPTS
=
VLC_TS_0
+
get_pts
(
&
p_block
->
p_buffer
[
offset
+
p_sys
->
i_Pts_Offset
]
);
if
(
p_sys
->
firstAudioPTS
<
0
)
p_sys
->
firstAudioPTS
=
p_sys
->
lastAudioPTS
;
p_block
->
i_pts
=
p_sys
->
lastAudioPTS
;
...
...
@@ -691,7 +693,7 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
{
//msg_Dbg(p_demux, "Video PES hdr in pkt type 0x%02x at offset %d",
//subrec_type, esOffset1);
p_sys
->
lastVideoPTS
=
get_pts
(
p_sys
->
lastVideoPTS
=
VLC_TS_0
+
get_pts
(
&
p_block_in
->
p_buffer
[
esOffset1
+
VIDEO_PTS_OFFSET
]
);
/*msg_Dbg(p_demux, "Video rec %d PTS %"PRId64, p_sys->i_cur_rec,
p_sys->lastVideoPTS );*/
...
...
@@ -748,13 +750,13 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
//p_sys->l_last_ty_pts += 33366667;
}
/* set PTS for this block before we send */
if
(
p_sys
->
lastVideoPTS
>
0
)
if
(
p_sys
->
lastVideoPTS
>
VLC_TS_INVALID
)
{
p_block_in
->
i_pts
=
p_sys
->
lastVideoPTS
;
/* PTS gets used ONCE.
* Any subsequent frames we get BEFORE next PES
* header will have their PTS computed in the codec */
p_sys
->
lastVideoPTS
=
0
;
p_sys
->
lastVideoPTS
=
VLC_TS_INVALID
;
}
}
...
...
@@ -787,7 +789,7 @@ static int DemuxRecVideo( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
}
/* Send the CC data */
if
(
p_block_in
->
i_pts
>
0
&&
p_sys
->
cc
.
i_data
>
0
)
if
(
p_block_in
->
i_pts
>
VLC_TS_INVALID
&&
p_sys
->
cc
.
i_data
>
0
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
...
...
@@ -871,7 +873,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
}
else
{
p_sys
->
lastAudioPTS
=
get_pts
(
p_sys
->
lastAudioPTS
=
VLC_TS_0
+
get_pts
(
&
p_sys
->
pes_buffer
[
esOffset1
+
p_sys
->
i_Pts_Offset
]
);
p_block_in
->
i_pts
=
p_sys
->
lastAudioPTS
;
}
...
...
@@ -910,7 +912,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/* ================================================ */
if
(
(
esOffset1
==
0
)
&&
(
l_rec_size
==
16
)
)
{
p_sys
->
lastAudioPTS
=
get_pts
(
&
p_block_in
->
p_buffer
[
p_sys
->
lastAudioPTS
=
VLC_TS_0
+
get_pts
(
&
p_block_in
->
p_buffer
[
SA_PTS_OFFSET
]
);
if
(
p_sys
->
firstAudioPTS
<
0
)
p_sys
->
firstAudioPTS
=
p_sys
->
lastAudioPTS
;
...
...
@@ -953,7 +955,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
/*msg_Dbg(p_demux,
"Adding SA Audio Packet Size %ld", l_rec_size ); */
if
(
p_sys
->
lastAudioPTS
>
0
)
if
(
p_sys
->
lastAudioPTS
>
VLC_TS_INVALID
)
p_block_in
->
i_pts
=
p_sys
->
lastAudioPTS
;
}
else
if
(
subrec_type
==
0x09
)
...
...
@@ -1004,7 +1006,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
}
/* set PCR before we send (if PTS found) */
if
(
p_block_in
->
i_pts
>
0
)
if
(
p_block_in
->
i_pts
>
VLC_TS_INVALID
)
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
p_block_in
->
i_pts
);
/* Send data */
...
...
@@ -1089,7 +1091,7 @@ static int ty_stream_seek_pct(demux_t *p_demux, double seek_pct)
(
p_sys
->
i_num_recs
*
16
)
+
l_skip_amt
+
4
);
/* to hell with syncing any audio or video, just start reading records... :) */
/*p_sys->lastAudioPTS = p_sys->lastVideoPTS =
0
;*/
/*p_sys->lastAudioPTS = p_sys->lastVideoPTS =
VLC_TS_INVALID
;*/
return
VLC_SUCCESS
;
}
...
...
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