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
cd089003
Commit
cd089003
authored
Jul 15, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: update pkt_duration for skipped samples.
Also: factor the the computation of the timestamp difference.
parent
d853ed46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
utils.c
libavcodec/utils.c
+7
-2
No files found.
libavcodec/utils.c
View file @
cd089003
...
...
@@ -1664,10 +1664,15 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
av_samples_copy
(
frame
->
extended_data
,
frame
->
extended_data
,
0
,
avctx
->
internal
->
skip_samples
,
frame
->
nb_samples
-
avctx
->
internal
->
skip_samples
,
avctx
->
channels
,
frame
->
format
);
if
(
avctx
->
pkt_timebase
.
num
&&
avctx
->
sample_rate
)
{
int64_t
diff_ts
=
av_rescale_q
(
avctx
->
internal
->
skip_samples
,
(
AVRational
){
1
,
avctx
->
sample_rate
},
avctx
->
pkt_timebase
);
if
(
frame
->
pkt_pts
!=
AV_NOPTS_VALUE
)
frame
->
pkt_pts
+=
av_rescale_q
(
avctx
->
internal
->
skip_samples
,(
AVRational
){
1
,
avctx
->
sample_rate
},
avctx
->
pkt_timebase
)
;
frame
->
pkt_pts
+=
diff_ts
;
if
(
frame
->
pkt_dts
!=
AV_NOPTS_VALUE
)
frame
->
pkt_dts
+=
av_rescale_q
(
avctx
->
internal
->
skip_samples
,(
AVRational
){
1
,
avctx
->
sample_rate
},
avctx
->
pkt_timebase
);
frame
->
pkt_dts
+=
diff_ts
;
if
(
frame
->
pkt_duration
>=
diff_ts
)
frame
->
pkt_duration
-=
diff_ts
;
}
else
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"Could not update timestamps for skipped samples.
\n
"
);
}
...
...
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