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
947e8ab3
Commit
947e8ab3
authored
Sep 28, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/fifo: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
parent
216830ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
fifo.c
libavfilter/fifo.c
+15
-15
No files found.
libavfilter/fifo.c
View file @
947e8ab3
...
...
@@ -53,38 +53,38 @@ typedef struct FifoContext {
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
FifoContext
*
fifo
=
ctx
->
priv
;
fifo
->
last
=
&
fifo
->
root
;
FifoContext
*
s
=
ctx
->
priv
;
s
->
last
=
&
s
->
root
;
return
0
;
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
FifoContext
*
fifo
=
ctx
->
priv
;
FifoContext
*
s
=
ctx
->
priv
;
Buf
*
buf
,
*
tmp
;
for
(
buf
=
fifo
->
root
.
next
;
buf
;
buf
=
tmp
)
{
for
(
buf
=
s
->
root
.
next
;
buf
;
buf
=
tmp
)
{
tmp
=
buf
->
next
;
av_frame_free
(
&
buf
->
frame
);
av_free
(
buf
);
}
av_frame_free
(
&
fifo
->
out
);
av_frame_free
(
&
s
->
out
);
}
static
int
add_to_queue
(
AVFilterLink
*
inlink
,
AVFrame
*
frame
)
{
FifoContext
*
fifo
=
inlink
->
dst
->
priv
;
FifoContext
*
s
=
inlink
->
dst
->
priv
;
fifo
->
last
->
next
=
av_mallocz
(
sizeof
(
Buf
));
if
(
!
fifo
->
last
->
next
)
{
s
->
last
->
next
=
av_mallocz
(
sizeof
(
Buf
));
if
(
!
s
->
last
->
next
)
{
av_frame_free
(
&
frame
);
return
AVERROR
(
ENOMEM
);
}
fifo
->
last
=
fifo
->
last
->
next
;
fifo
->
last
->
frame
=
frame
;
s
->
last
=
s
->
last
->
next
;
s
->
last
->
frame
=
frame
;
return
0
;
}
...
...
@@ -229,24 +229,24 @@ static int return_audio_frame(AVFilterContext *ctx)
static
int
request_frame
(
AVFilterLink
*
outlink
)
{
FifoContext
*
fifo
=
outlink
->
src
->
priv
;
FifoContext
*
s
=
outlink
->
src
->
priv
;
int
ret
=
0
;
if
(
!
fifo
->
root
.
next
)
{
if
(
!
s
->
root
.
next
)
{
if
((
ret
=
ff_request_frame
(
outlink
->
src
->
inputs
[
0
]))
<
0
)
{
if
(
ret
==
AVERROR_EOF
&&
outlink
->
request_samples
)
return
return_audio_frame
(
outlink
->
src
);
return
ret
;
}
if
(
!
fifo
->
root
.
next
)
if
(
!
s
->
root
.
next
)
return
0
;
}
if
(
outlink
->
request_samples
)
{
return
return_audio_frame
(
outlink
->
src
);
}
else
{
ret
=
ff_filter_frame
(
outlink
,
fifo
->
root
.
next
->
frame
);
queue_pop
(
fifo
);
ret
=
ff_filter_frame
(
outlink
,
s
->
root
.
next
->
frame
);
queue_pop
(
s
);
}
return
ret
;
...
...
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