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
2243f0d0
Commit
2243f0d0
authored
Jun 18, 2012
by
Michael Bradshaw
Committed by
Nicolas George
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: add field for how duration is estimated
Signed-off-by:
Michael Bradshaw
<
mbradshaw@sorensonmedia.com
>
parent
3b3150ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
2 deletions
+27
-2
avformat.h
libavformat/avformat.h
+17
-0
options.c
libavformat/options.c
+5
-0
utils.c
libavformat/utils.c
+3
-0
version.h
libavformat/version.h
+2
-2
No files found.
libavformat/avformat.h
View file @
2243f0d0
...
...
@@ -1099,8 +1099,25 @@ typedef struct AVFormatContext {
int
raw_packet_buffer_remaining_size
;
int
avio_flags
;
/**
* The duration field can be estimated through various ways, and this field can be used
* to know how the duration was estimated.
*/
enum
{
AVFMT_DURATION_FROM_PTS
,
///< duration accurately estimated from PTSes
AVFMT_DURATION_FROM_STREAM
,
///< duration estimated from a stream with a known duration
AVFMT_DURATION_FROM_BITRATE
///< duration estimated from bitrate (less accurate)
}
duration_estimation_method
;
}
AVFormatContext
;
/**
* Returns the method used to set ctx->duration.
*
* @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE.
*/
int
av_fmt_ctx_get_duration_estimation_method
(
const
AVFormatContext
*
ctx
);
typedef
struct
AVPacketList
{
AVPacket
pkt
;
struct
AVPacketList
*
next
;
...
...
libavformat/options.c
View file @
2243f0d0
...
...
@@ -104,6 +104,11 @@ AVFormatContext *avformat_alloc_context(void)
return
ic
;
}
int
av_fmt_ctx_get_duration_estimation_method
(
const
AVFormatContext
*
ctx
)
{
return
ctx
->
duration_estimation_method
;
}
const
AVClass
*
avformat_get_class
(
void
)
{
return
&
av_format_context_class
;
...
...
libavformat/utils.c
View file @
2243f0d0
...
...
@@ -2228,14 +2228,17 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
file_size
&&
ic
->
pb
->
seekable
)
{
/* get accurate estimate from the PTSes */
estimate_timings_from_pts
(
ic
,
old_offset
);
ic
->
duration_estimation_method
=
AVFMT_DURATION_FROM_PTS
;
}
else
if
(
has_duration
(
ic
))
{
/* at least one component has timings - we use them for all
the components */
fill_all_stream_timings
(
ic
);
ic
->
duration_estimation_method
=
AVFMT_DURATION_FROM_STREAM
;
}
else
{
av_log
(
ic
,
AV_LOG_WARNING
,
"Estimating duration from bitrate, this may be inaccurate
\n
"
);
/* less precise: use bitrate info */
estimate_timings_from_bit_rate
(
ic
);
ic
->
duration_estimation_method
=
AVFMT_DURATION_FROM_BITRATE
;
}
update_stream_timings
(
ic
);
...
...
libavformat/version.h
View file @
2243f0d0
...
...
@@ -30,8 +30,8 @@
#include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 54
#define LIBAVFORMAT_VERSION_MINOR
6
#define LIBAVFORMAT_VERSION_MICRO 10
1
#define LIBAVFORMAT_VERSION_MINOR
7
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
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