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
b0e78a0a
Commit
b0e78a0a
authored
Feb 01, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* ts: implemented the same detection than mpeg/ts.c
parent
4c8d50cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
3 deletions
+26
-3
modules/demux/ts.c
modules/demux/ts.c
+26
-3
No files found.
modules/demux/ts.c
View file @
b0e78a0a
...
...
@@ -2,7 +2,7 @@
* ts.c: Transport Stream input module for VLC.
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: ts.c,v 1.
9 2004/01/30 17:50:05
fenrir Exp $
* $Id: ts.c,v 1.
10 2004/02/01 04:50:13
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -249,6 +249,7 @@ static int Open( vlc_object_t *p_this )
uint8_t
*
p_peek
;
int
i_peek
;
int
i_sync
;
int
i
;
ts_pid_t
*
pat
;
...
...
@@ -260,15 +261,37 @@ static int Open( vlc_object_t *p_this )
msg_Err
(
p_demux
,
"cannot peek"
);
return
VLC_EGENERIC
;
}
if
(
p_peek
[
0
]
!=
0x47
||
(
i_peek
>=
189
&&
p_peek
[
188
]
!=
0x47
)
)
/* Search first synch */
for
(
i_sync
=
0
;
i_sync
<
i_peek
;
i_sync
++
)
{
if
(
p_peek
[
i_sync
]
==
0x47
)
break
;
}
if
(
i_sync
>=
i_peek
)
{
if
(
strcmp
(
p_demux
->
psz_demux
,
"ts"
)
)
if
(
strcmp
(
p_demux
->
psz_demux
,
"ts
2
"
)
)
{
msg_Warn
(
p_demux
,
"TS module discarded"
);
return
VLC_EGENERIC
;
}
msg_Warn
(
p_demux
,
"this does not look like a TS stream, continuing"
);
}
if
(
strcmp
(
p_demux
->
psz_demux
,
"ts2"
)
)
{
/* Check next 3 sync points */
i_peek
=
188
*
3
+
1
+
i_sync
;
if
(
(
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
i_peek
)
)
<
i_peek
)
{
msg_Err
(
p_demux
,
"cannot peek"
);
return
VLC_EGENERIC
;
}
if
(
p_peek
[
i_sync
+
188
]
!=
0x47
||
p_peek
[
i_sync
+
2
*
188
]
!=
0x47
||
p_peek
[
i_sync
+
3
*
188
]
!=
0x47
)
{
msg_Warn
(
p_demux
,
"TS module discarded (lost sync)"
);
return
VLC_EGENERIC
;
}
}
/* Fill p_demux field */
p_demux
->
pf_demux
=
Demux
;
...
...
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