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
9de40bf6
Commit
9de40bf6
authored
Aug 02, 2019
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mpegtsenc: remove section_write_packet forward declaration
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
47ea654b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
mpegtsenc.c
libavformat/mpegtsenc.c
+24
-26
No files found.
libavformat/mpegtsenc.c
View file @
9de40bf6
...
...
@@ -717,7 +717,30 @@ invalid:
return
0
;
}
static
void
section_write_packet
(
MpegTSSection
*
s
,
const
uint8_t
*
packet
);
static
int64_t
get_pcr
(
const
MpegTSWrite
*
ts
,
AVIOContext
*
pb
)
{
return
av_rescale
(
avio_tell
(
pb
)
+
11
,
8
*
PCR_TIME_BASE
,
ts
->
mux_rate
)
+
ts
->
first_pcr
;
}
static
void
mpegts_prefix_m2ts_header
(
AVFormatContext
*
s
)
{
MpegTSWrite
*
ts
=
s
->
priv_data
;
if
(
ts
->
m2ts_mode
)
{
int64_t
pcr
=
get_pcr
(
s
->
priv_data
,
s
->
pb
);
uint32_t
tp_extra_header
=
pcr
%
0x3fffffff
;
tp_extra_header
=
AV_RB32
(
&
tp_extra_header
);
avio_write
(
s
->
pb
,
(
unsigned
char
*
)
&
tp_extra_header
,
sizeof
(
tp_extra_header
));
}
}
static
void
section_write_packet
(
MpegTSSection
*
s
,
const
uint8_t
*
packet
)
{
AVFormatContext
*
ctx
=
s
->
opaque
;
mpegts_prefix_m2ts_header
(
ctx
);
avio_write
(
ctx
->
pb
,
packet
,
TS_PACKET_SIZE
);
}
static
MpegTSService
*
mpegts_add_service
(
AVFormatContext
*
s
,
int
sid
,
const
AVDictionary
*
metadata
,
...
...
@@ -762,31 +785,6 @@ fail:
return
NULL
;
}
static
int64_t
get_pcr
(
const
MpegTSWrite
*
ts
,
AVIOContext
*
pb
)
{
return
av_rescale
(
avio_tell
(
pb
)
+
11
,
8
*
PCR_TIME_BASE
,
ts
->
mux_rate
)
+
ts
->
first_pcr
;
}
static
void
mpegts_prefix_m2ts_header
(
AVFormatContext
*
s
)
{
MpegTSWrite
*
ts
=
s
->
priv_data
;
if
(
ts
->
m2ts_mode
)
{
int64_t
pcr
=
get_pcr
(
s
->
priv_data
,
s
->
pb
);
uint32_t
tp_extra_header
=
pcr
%
0x3fffffff
;
tp_extra_header
=
AV_RB32
(
&
tp_extra_header
);
avio_write
(
s
->
pb
,
(
unsigned
char
*
)
&
tp_extra_header
,
sizeof
(
tp_extra_header
));
}
}
static
void
section_write_packet
(
MpegTSSection
*
s
,
const
uint8_t
*
packet
)
{
AVFormatContext
*
ctx
=
s
->
opaque
;
mpegts_prefix_m2ts_header
(
ctx
);
avio_write
(
ctx
->
pb
,
packet
,
TS_PACKET_SIZE
);
}
static
void
enable_pcr_generation_for_stream
(
AVFormatContext
*
s
,
AVStream
*
pcr_st
)
{
MpegTSWrite
*
ts
=
s
->
priv_data
;
...
...
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