Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7968059e
Commit
7968059e
authored
Aug 25, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegts: Allow custom max resync size
parent
94f08432
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
+22
-2
mpegts.c
libavformat/mpegts.c
+22
-2
No files found.
libavformat/mpegts.c
View file @
7968059e
...
...
@@ -126,6 +126,8 @@ struct MpegTSContext {
/** to detect seek */
int64_t
last_pos
;
int
resync_size
;
/******************************************/
/* private mpegts data */
/* scan context */
...
...
@@ -137,7 +139,23 @@ struct MpegTSContext {
MpegTSFilter
*
pids
[
NB_PID_MAX
];
};
#define MPEGTS_OPTIONS \
{ "resync_size", "Size limit for looking up a new syncronization.", offsetof(MpegTSContext, resync_size), AV_OPT_TYPE_INT, { .i64 = MAX_RESYNC_SIZE}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }
static
const
AVOption
options
[]
=
{
MPEGTS_OPTIONS
,
{
NULL
},
};
static
const
AVClass
mpegts_class
=
{
.
class_name
=
"mpegts demuxer"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVOption
raw_options
[]
=
{
MPEGTS_OPTIONS
,
{
"compute_pcr"
,
"Compute exact PCR for each transport stream packet."
,
offsetof
(
MpegTSContext
,
mpeg2ts_compute_pcr
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
AV_OPT_FLAG_DECODING_PARAM
},
...
...
@@ -151,7 +169,7 @@ static const AVOption options[] = {
static
const
AVClass
mpegtsraw_class
=
{
.
class_name
=
"mpegtsraw demuxer"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
option
=
raw_
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
...
...
@@ -1805,10 +1823,11 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
* get_packet_size() ?) */
static
int
mpegts_resync
(
AVFormatContext
*
s
)
{
MpegTSContext
*
ts
=
s
->
priv_data
;
AVIOContext
*
pb
=
s
->
pb
;
int
c
,
i
;
for
(
i
=
0
;
i
<
MAX_RESYNC_SIZE
;
i
++
)
{
for
(
i
=
0
;
i
<
ts
->
resync_size
;
i
++
)
{
c
=
avio_r8
(
pb
);
if
(
pb
->
eof_reached
)
return
AVERROR_EOF
;
...
...
@@ -2285,6 +2304,7 @@ AVInputFormat ff_mpegts_demuxer = {
.
read_seek
=
read_seek
,
.
read_timestamp
=
mpegts_get_pcr
,
.
flags
=
AVFMT_SHOW_IDS
|
AVFMT_TS_DISCONT
,
.
priv_class
=
&
mpegts_class
,
};
AVInputFormat
ff_mpegtsraw_demuxer
=
{
...
...
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