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
31f9032b
Commit
31f9032b
authored
Oct 26, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: add audio_preload option, this allows interleaving audio earlier
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
54e40b9c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
avformat.h
libavformat/avformat.h
+7
-0
options.c
libavformat/options.c
+1
-0
utils.c
libavformat/utils.c
+10
-0
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/avformat.h
View file @
31f9032b
...
...
@@ -1078,6 +1078,13 @@ typedef struct AVFormatContext {
*/
int
ts_id
;
/**
* Audio preload in microseconds.
* Note, not all formats support this and unpredictable things may happen if it is used when not supported.
* - encoding: Set by user via AVOptions (NO direct access)
* - decoding: unused
*/
int
audio_preload
;
/*****************************************************************
* All fields below this line are not part of the public API. They
...
...
libavformat/options.c
View file @
31f9032b
...
...
@@ -116,6 +116,7 @@ static const AVOption options[]={
{
"careful"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
FF_ER_CAREFUL
},
INT_MIN
,
INT_MAX
,
D
,
"fer"
},
{
"explode"
,
"abort decoding on error recognition"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
FF_ER_EXPLODE
},
INT_MIN
,
INT_MAX
,
D
,
"fer"
},
{
"fpsprobesize"
,
"number of frames used to probe fps"
,
OFFSET
(
fps_probe_size
),
AV_OPT_TYPE_INT
,
{.
dbl
=
-
1
},
-
1
,
INT_MAX
-
1
,
D
},
{
"audio_preload"
,
"microseconds by which audio packets should be interleaved earlier"
,
OFFSET
(
audio_preload
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
-
1
,
E
},
{
NULL
},
};
...
...
libavformat/utils.c
View file @
31f9032b
...
...
@@ -3308,6 +3308,16 @@ static int ff_interleave_compare_dts(AVFormatContext *s, AVPacket *next, AVPacke
AVStream
*
st2
=
s
->
streams
[
next
->
stream_index
];
int
comp
=
av_compare_ts
(
next
->
dts
,
st2
->
time_base
,
pkt
->
dts
,
st
->
time_base
);
if
(
s
->
audio_preload
&&
((
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
!=
(
st2
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
))){
int64_t
ts
=
av_rescale_q
(
pkt
->
dts
,
st
->
time_base
,
AV_TIME_BASE_Q
)
-
s
->
audio_preload
*
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
);
int64_t
ts2
=
av_rescale_q
(
next
->
dts
,
st2
->
time_base
,
AV_TIME_BASE_Q
)
-
s
->
audio_preload
*
(
st2
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
);
if
(
ts
==
ts2
){
ts
=
(
pkt
->
dts
*
st
->
time_base
.
num
*
AV_TIME_BASE
-
s
->
audio_preload
*
(
int64_t
)(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
*
st
->
time_base
.
den
)
*
st2
->
time_base
.
den
-
(
next
->
dts
*
st2
->
time_base
.
num
*
AV_TIME_BASE
-
s
->
audio_preload
*
(
int64_t
)(
st2
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
*
st2
->
time_base
.
den
)
*
st
->
time_base
.
den
;
ts2
=
0
;
}
comp
=
(
ts
>
ts2
)
-
(
ts
<
ts2
);
}
if
(
comp
==
0
)
return
pkt
->
stream_index
<
next
->
stream_index
;
...
...
libavformat/version.h
View file @
31f9032b
...
...
@@ -24,7 +24,7 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 53
#define LIBAVFORMAT_VERSION_MINOR 2
2
#define LIBAVFORMAT_VERSION_MINOR 2
3
#define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
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