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
746e3142
Commit
746e3142
authored
11 years ago
by
Paul B Mahol
Browse files
Options
Downloads
Patches
Plain Diff
avfilter/f_interleave: use the name 's' for the pointer to the private context
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
4b05906e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavfilter/f_interleave.c
+15
-15
15 additions, 15 deletions
libavfilter/f_interleave.c
with
15 additions
and
15 deletions
libavfilter/f_interleave.c
+
15
−
15
View file @
746e3142
...
...
@@ -50,14 +50,14 @@ static const AVOption filt_name##_options[] = { \
inline
static
int
push_frame
(
AVFilterContext
*
ctx
)
{
InterleaveContext
*
interleave
=
ctx
->
priv
;
InterleaveContext
*
s
=
ctx
->
priv
;
AVFrame
*
frame
;
int
i
,
queue_idx
=
-
1
;
int64_t
pts_min
=
INT64_MAX
;
/* look for oldest frame */
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
{
struct
FFBufQueue
*
q
=
&
interleave
->
queues
[
i
];
struct
FFBufQueue
*
q
=
&
s
->
queues
[
i
];
if
(
!
q
->
available
&&
!
ctx
->
inputs
[
i
]
->
closed
)
return
0
;
...
...
@@ -74,7 +74,7 @@ inline static int push_frame(AVFilterContext *ctx)
if
(
queue_idx
<
0
)
return
AVERROR_EOF
;
frame
=
ff_bufqueue_get
(
&
interleave
->
queues
[
queue_idx
]);
frame
=
ff_bufqueue_get
(
&
s
->
queues
[
queue_idx
]);
av_log
(
ctx
,
AV_LOG_DEBUG
,
"queue:%d -> frame time:%f
\n
"
,
queue_idx
,
frame
->
pts
*
av_q2d
(
AV_TIME_BASE_Q
));
return
ff_filter_frame
(
ctx
->
outputs
[
0
],
frame
);
...
...
@@ -83,7 +83,7 @@ inline static int push_frame(AVFilterContext *ctx)
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
frame
)
{
AVFilterContext
*
ctx
=
inlink
->
dst
;
InterleaveContext
*
interleave
=
ctx
->
priv
;
InterleaveContext
*
s
=
ctx
->
priv
;
unsigned
in_no
=
FF_INLINK_IDX
(
inlink
);
if
(
frame
->
pts
==
AV_NOPTS_VALUE
)
{
...
...
@@ -96,23 +96,23 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
/* queue frame */
frame
->
pts
=
av_rescale_q
(
frame
->
pts
,
inlink
->
time_base
,
AV_TIME_BASE_Q
);
av_log
(
ctx
,
AV_LOG_DEBUG
,
"frame pts:%f -> queue idx:%d available:%d
\n
"
,
frame
->
pts
*
av_q2d
(
AV_TIME_BASE_Q
),
in_no
,
interleave
->
queues
[
in_no
].
available
);
ff_bufqueue_add
(
ctx
,
&
interleave
->
queues
[
in_no
],
frame
);
frame
->
pts
*
av_q2d
(
AV_TIME_BASE_Q
),
in_no
,
s
->
queues
[
in_no
].
available
);
ff_bufqueue_add
(
ctx
,
&
s
->
queues
[
in_no
],
frame
);
return
push_frame
(
ctx
);
}
static
av_cold
int
init
(
AVFilterContext
*
ctx
)
{
InterleaveContext
*
interleave
=
ctx
->
priv
;
InterleaveContext
*
s
=
ctx
->
priv
;
const
AVFilterPad
*
outpad
=
&
ctx
->
filter
->
outputs
[
0
];
int
i
;
interleave
->
queues
=
av_calloc
(
interleave
->
nb_inputs
,
sizeof
(
interleave
->
queues
[
0
]));
if
(
!
interleave
->
queues
)
s
->
queues
=
av_calloc
(
s
->
nb_inputs
,
sizeof
(
s
->
queues
[
0
]));
if
(
!
s
->
queues
)
return
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
interleave
->
nb_inputs
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_inputs
;
i
++
)
{
AVFilterPad
inpad
=
{
0
};
inpad
.
name
=
av_asprintf
(
"input%d"
,
i
);
...
...
@@ -137,12 +137,12 @@ static av_cold int init(AVFilterContext *ctx)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
InterleaveContext
*
interleave
=
ctx
->
priv
;
InterleaveContext
*
s
=
ctx
->
priv
;
int
i
;
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
{
ff_bufqueue_discard_all
(
&
interleave
->
queues
[
i
]);
av_freep
(
&
interleave
->
queues
[
i
]);
ff_bufqueue_discard_all
(
&
s
->
queues
[
i
]);
av_freep
(
&
s
->
queues
[
i
]);
av_freep
(
&
ctx
->
input_pads
[
i
].
name
);
}
}
...
...
@@ -188,11 +188,11 @@ static int config_output(AVFilterLink *outlink)
static
int
request_frame
(
AVFilterLink
*
outlink
)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
InterleaveContext
*
interleave
=
ctx
->
priv
;
InterleaveContext
*
s
=
ctx
->
priv
;
int
i
,
ret
;
for
(
i
=
0
;
i
<
ctx
->
nb_inputs
;
i
++
)
{
if
(
!
interleave
->
queues
[
i
].
available
&&
!
ctx
->
inputs
[
i
]
->
closed
)
{
if
(
!
s
->
queues
[
i
].
available
&&
!
ctx
->
inputs
[
i
]
->
closed
)
{
ret
=
ff_request_frame
(
ctx
->
inputs
[
i
]);
if
(
ret
!=
AVERROR_EOF
)
return
ret
;
...
...
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