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
325846aa
Commit
325846aa
authored
Mar 31, 2013
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffplay: set time_base of audio filter buffer src
Fixes ticket #2408. Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
ed8373e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
ffplay.c
ffplay.c
+7
-4
No files found.
ffplay.c
View file @
325846aa
...
...
@@ -1828,9 +1828,10 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for
return
AVERROR
(
ENOMEM
);
ret
=
snprintf
(
asrc_args
,
sizeof
(
asrc_args
),
"sample_rate=%d:sample_fmt=%s:channels=%d"
,
"sample_rate=%d:sample_fmt=%s:channels=%d
:time_base=%d/%d
"
,
is
->
audio_filter_src
.
freq
,
av_get_sample_fmt_name
(
is
->
audio_filter_src
.
fmt
),
is
->
audio_filter_src
.
channels
);
is
->
audio_filter_src
.
channels
,
1
,
is
->
audio_filter_src
.
freq
);
if
(
is
->
audio_filter_src
.
channel_layout
)
snprintf
(
asrc_args
+
ret
,
sizeof
(
asrc_args
)
-
ret
,
":channel_layout=0x%"
PRIx64
,
is
->
audio_filter_src
.
channel_layout
);
...
...
@@ -2190,11 +2191,13 @@ static int audio_decode_frame(VideoState *is)
continue
;
}
tb
=
(
AVRational
){
1
,
is
->
frame
->
sample_rate
};
if
(
is
->
frame
->
pts
!=
AV_NOPTS_VALUE
)
is
->
frame
->
pts
=
av_rescale_q
(
is
->
frame
->
pts
,
dec
->
time_base
,
tb
);
if
(
is
->
frame
->
pts
==
AV_NOPTS_VALUE
&&
pkt_temp
->
pts
!=
AV_NOPTS_VALUE
)
is
->
frame
->
pts
=
av_rescale_q
(
pkt_temp
->
pts
,
is
->
audio_st
->
time_base
,
dec
->
time_base
);
is
->
frame
->
pts
=
av_rescale_q
(
pkt_temp
->
pts
,
is
->
audio_st
->
time_base
,
tb
);
if
(
pkt_temp
->
pts
!=
AV_NOPTS_VALUE
)
pkt_temp
->
pts
+=
(
double
)
is
->
frame
->
nb_samples
/
is
->
frame
->
sample_rate
/
av_q2d
(
is
->
audio_st
->
time_base
);
tb
=
dec
->
time_base
;
#if CONFIG_AVFILTER
{
...
...
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