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
be97675e
Commit
be97675e
authored
May 26, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_aresample: fix pts, they where off by a packet in the -async >0 case.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
aeb2dea8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
af_aresample.c
libavfilter/af_aresample.c
+12
-23
No files found.
libavfilter/af_aresample.c
View file @
be97675e
...
...
@@ -174,31 +174,9 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
AVFilterLink
*
const
outlink
=
inlink
->
dst
->
outputs
[
0
];
AVFilterBufferRef
*
outsamplesref
=
ff_get_audio_buffer
(
outlink
,
AV_PERM_WRITE
,
n_out
);
n_out
=
swr_convert
(
aresample
->
swr
,
outsamplesref
->
extended_data
,
n_out
,
(
void
*
)
insamplesref
->
extended_data
,
n_in
);
if
(
n_out
<=
0
)
{
avfilter_unref_buffer
(
outsamplesref
);
avfilter_unref_buffer
(
insamplesref
);
return
;
}
avfilter_copy_buffer_ref_props
(
outsamplesref
,
insamplesref
);
outsamplesref
->
audio
->
sample_rate
=
outlink
->
sample_rate
;
outsamplesref
->
audio
->
nb_samples
=
n_out
;
#if 0
if(insamplesref->pts != AV_NOPTS_VALUE) {
aresample->next_pts =
outsamplesref->pts = av_rescale_q(insamplesref->pts, inlink->time_base, outlink->time_base)
- swr_get_delay(aresample->swr, outlink->time_base.den);
av_assert0(outlink->time_base.num == 1);
} else{
outsamplesref->pts = AV_NOPTS_VALUE; //aresample->next_pts;
}
if(aresample->next_pts != AV_NOPTS_VALUE)
aresample->next_pts += av_rescale_q(n_out, (AVRational){1 ,outlink->sample_rate}, outlink->time_base);
#else
if
(
insamplesref
->
pts
!=
AV_NOPTS_VALUE
)
{
int64_t
inpts
=
av_rescale
(
insamplesref
->
pts
,
inlink
->
time_base
.
num
*
(
int64_t
)
outlink
->
sample_rate
*
inlink
->
sample_rate
,
inlink
->
time_base
.
den
);
int64_t
outpts
=
swr_next_pts
(
aresample
->
swr
,
inpts
);
...
...
@@ -207,7 +185,18 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
}
else
{
outsamplesref
->
pts
=
AV_NOPTS_VALUE
;
}
#endif
n_out
=
swr_convert
(
aresample
->
swr
,
outsamplesref
->
extended_data
,
n_out
,
(
void
*
)
insamplesref
->
extended_data
,
n_in
);
if
(
n_out
<=
0
)
{
avfilter_unref_buffer
(
outsamplesref
);
avfilter_unref_buffer
(
insamplesref
);
return
;
}
outsamplesref
->
audio
->
sample_rate
=
outlink
->
sample_rate
;
outsamplesref
->
audio
->
nb_samples
=
n_out
;
ff_filter_samples
(
outlink
,
outsamplesref
);
aresample
->
req_fullfilled
=
1
;
avfilter_unref_buffer
(
insamplesref
);
...
...
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