Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
5d4d67e0
Commit
5d4d67e0
authored
19 years ago
by
Nico Sabbi
Browse files
Options
Downloads
Patches
Plain Diff
added support for DVHS (192) packet size
Originally committed as revision 4801 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
f007d358
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavformat/mpegts.c
+11
-7
11 additions, 7 deletions
libavformat/mpegts.c
libavformat/mpegts.h
+1
-0
1 addition, 0 deletions
libavformat/mpegts.h
with
12 additions
and
7 deletions
libavformat/mpegts.c
+
11
−
7
View file @
5d4d67e0
...
...
@@ -246,17 +246,19 @@ static int analyze(const uint8_t *buf, int size, int packet_size, int *index){
/* autodetect fec presence. Must have at least 1024 bytes */
static
int
get_packet_size
(
const
uint8_t
*
buf
,
int
size
)
{
int
score
,
fec_score
;
int
score
,
fec_score
,
dvhs_score
;
if
(
size
<
(
TS_FEC_PACKET_SIZE
*
5
+
1
))
return
-
1
;
score
=
analyze
(
buf
,
size
,
TS_PACKET_SIZE
,
NULL
);
dvhs_score
=
analyze
(
buf
,
size
,
TS_DVHS_PACKET_SIZE
,
NULL
);
fec_score
=
analyze
(
buf
,
size
,
TS_FEC_PACKET_SIZE
,
NULL
);
// av_log(NULL, AV_LOG_DEBUG, "score: %d, fec_score: %d \n", score, fec_score);
// av_log(NULL, AV_LOG_DEBUG, "score: %d,
dvhs_score: %d,
fec_score: %d \n", score,
dvhs_score,
fec_score);
if
(
score
>
fec_score
)
return
TS_PACKET_SIZE
;
else
if
(
score
<
fec_score
)
return
TS_FEC_PACKET_SIZE
;
if
(
score
>
fec_score
&&
score
>
dvhs_score
)
return
TS_PACKET_SIZE
;
else
if
(
dvhs_score
>
score
&&
dvhs_score
>
fec_score
)
return
TS_DVHS_PACKET_SIZE
;
else
if
(
score
<
fec_score
&&
dvhs_score
<
fec_score
)
return
TS_FEC_PACKET_SIZE
;
else
return
-
1
;
}
...
...
@@ -1094,18 +1096,20 @@ static int mpegts_probe(AVProbeData *p)
{
#if 1
const
int
size
=
p
->
buf_size
;
int
score
,
fec_score
;
int
score
,
fec_score
,
dvhs_score
;
#define CHECK_COUNT 10
if
(
size
<
(
TS_FEC_PACKET_SIZE
*
CHECK_COUNT
))
return
-
1
;
score
=
analyze
(
p
->
buf
,
TS_PACKET_SIZE
*
CHECK_COUNT
,
TS_PACKET_SIZE
,
NULL
);
dvhs_score
=
analyze
(
p
->
buf
,
TS_DVHS_PACKET_SIZE
*
CHECK_COUNT
,
TS_DVHS_PACKET_SIZE
,
NULL
);
fec_score
=
analyze
(
p
->
buf
,
TS_FEC_PACKET_SIZE
*
CHECK_COUNT
,
TS_FEC_PACKET_SIZE
,
NULL
);
// av_log(NULL, AV_LOG_DEBUG, "score: %d, fec_score: %d \n", score, fec_score);
// av_log(NULL, AV_LOG_DEBUG, "score: %d,
dvhs_score: %d,
fec_score: %d \n", score,
dvhs_score,
fec_score);
// we need a clear definition for the returned score otherwise things will become messy sooner or later
if
(
score
>
fec_score
&&
score
>
6
)
return
AVPROBE_SCORE_MAX
+
score
-
CHECK_COUNT
;
if
(
score
>
fec_score
&&
score
>
dvhs_score
&&
score
>
6
)
return
AVPROBE_SCORE_MAX
+
score
-
CHECK_COUNT
;
else
if
(
dvhs_score
>
score
&&
dvhs_score
>
fec_score
&&
dvhs_score
>
6
)
return
AVPROBE_SCORE_MAX
+
dvhs_score
-
CHECK_COUNT
;
else
if
(
fec_score
>
6
)
return
AVPROBE_SCORE_MAX
+
fec_score
-
CHECK_COUNT
;
else
return
-
1
;
#else
...
...
This diff is collapsed.
Click to expand it.
libavformat/mpegts.h
+
1
−
0
View file @
5d4d67e0
...
...
@@ -18,6 +18,7 @@
*/
#define TS_FEC_PACKET_SIZE 204
#define TS_DVHS_PACKET_SIZE 192
#define TS_PACKET_SIZE 188
#define NB_PID_MAX 8192
#define MAX_SECTION_SIZE 4096
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment