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
c31ba86c
Commit
c31ba86c
authored
Mar 26, 2020
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mux: factorize interleaved write_packet
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
7a8a5c20
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
31 deletions
+21
-31
mux.c
libavformat/mux.c
+21
-31
No files found.
libavformat/mux.c
View file @
c31ba86c
...
...
@@ -1125,6 +1125,25 @@ static int do_packet_auto_bsf(AVFormatContext *s, AVPacket *pkt) {
return
1
;
}
static
int
interleaved_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
,
int
flush
)
{
for
(;;
)
{
AVPacket
opkt
;
int
ret
=
interleave_packet
(
s
,
&
opkt
,
pkt
,
flush
);
if
(
ret
<=
0
)
return
ret
;
pkt
=
NULL
;
ret
=
write_packet
(
s
,
&
opkt
);
av_packet_unref
(
&
opkt
);
if
(
ret
<
0
)
return
ret
;
}
}
int
av_write_frame
(
AVFormatContext
*
s
,
AVPacket
*
in
)
{
AVPacket
local_pkt
,
*
pkt
=
&
local_pkt
;
...
...
@@ -1220,22 +1239,8 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
av_log
(
s
,
AV_LOG_TRACE
,
"av_interleaved_write_frame FLUSH
\n
"
);
flush
=
1
;
}
return
interleaved_write_packet
(
s
,
pkt
,
flush
);
for
(;;
)
{
AVPacket
opkt
;
int
ret
=
interleave_packet
(
s
,
&
opkt
,
pkt
,
flush
);
if
(
ret
<=
0
)
return
ret
;
pkt
=
NULL
;
ret
=
write_packet
(
s
,
&
opkt
);
av_packet_unref
(
&
opkt
);
if
(
ret
<
0
)
return
ret
;
}
fail:
av_packet_unref
(
pkt
);
return
ret
;
...
...
@@ -1245,23 +1250,8 @@ int av_write_trailer(AVFormatContext *s)
{
int
ret
,
i
;
for
(;;
)
{
AVPacket
pkt
;
ret
=
interleave_packet
(
s
,
&
pkt
,
NULL
,
1
);
if
(
ret
<
0
)
goto
fail
;
if
(
!
ret
)
break
;
ret
=
write_packet
(
s
,
&
pkt
);
av_packet_unref
(
&
pkt
);
ret
=
interleaved_write_packet
(
s
,
NULL
,
1
);
if
(
ret
<
0
)
goto
fail
;
}
fail:
if
(
s
->
oformat
->
write_trailer
)
{
if
(
!
(
s
->
oformat
->
flags
&
AVFMT_NOFILE
)
&&
s
->
pb
)
avio_write_marker
(
s
->
pb
,
AV_NOPTS_VALUE
,
AVIO_DATA_MARKER_TRAILER
);
...
...
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