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
0fcc2528
Commit
0fcc2528
authored
Jun 07, 2016
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "avfilter/trim: add compatibility layer to not break ABI used by ffmpeg"
This reverts commit
9219ec93
. Fixes Ticket 5411
parent
b51d5c99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
21 deletions
+5
-21
trim.c
libavfilter/trim.c
+5
-21
No files found.
libavfilter/trim.c
View file @
0fcc2528
...
...
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <float.h>
#include <math.h>
#include <stdint.h>
#include "config.h"
...
...
@@ -43,9 +41,6 @@ typedef struct TrimContext {
int64_t
duration
;
int64_t
start_time
,
end_time
;
int64_t
start_frame
,
end_frame
;
double
duration_dbl
;
double
start_time_dbl
,
end_time_dbl
;
/*
* in the link timebase for video,
* in 1/samplerate for audio
...
...
@@ -91,13 +86,6 @@ static int config_input(AVFilterLink *inlink)
AVRational
tb
=
(
inlink
->
type
==
AVMEDIA_TYPE_VIDEO
)
?
inlink
->
time_base
:
(
AVRational
){
1
,
inlink
->
sample_rate
};
if
(
s
->
start_time_dbl
!=
DBL_MAX
)
s
->
start_time
=
s
->
start_time_dbl
*
1e6
;
if
(
s
->
end_time_dbl
!=
DBL_MAX
)
s
->
end_time
=
s
->
end_time_dbl
*
1e6
;
if
(
s
->
duration_dbl
!=
0
)
s
->
duration
=
s
->
duration_dbl
*
1e6
;
if
(
s
->
start_time
!=
INT64_MAX
)
{
int64_t
start_pts
=
av_rescale_q
(
s
->
start_time
,
AV_TIME_BASE_Q
,
tb
);
if
(
s
->
start_pts
==
AV_NOPTS_VALUE
||
start_pts
<
s
->
start_pts
)
...
...
@@ -116,23 +104,21 @@ static int config_input(AVFilterLink *inlink)
#define OFFSET(x) offsetof(TrimContext, x)
#define COMMON_OPTS \
{ "start", "Timestamp of the first frame that " \
"should be passed", OFFSET(start_time), AV_OPT_TYPE_DURATION, { .i64 = INT64_MAX }, INT64_MIN, INT64_MAX, FLAGS }, \
{ "starti", "Timestamp of the first frame that " \
"should be passed", OFFSET(start_time), AV_OPT_TYPE_DURATION, { .i64 = INT64_MAX }, INT64_MIN, INT64_MAX, FLAGS }, \
{ "end", "Timestamp of the first frame that " \
"should be dropped again", OFFSET(end_time), AV_OPT_TYPE_DURATION, { .i64 = INT64_MAX }, INT64_MIN, INT64_MAX, FLAGS }, \
{ "endi", "Timestamp of the first frame that " \
"should be dropped again", OFFSET(end_time), AV_OPT_TYPE_DURATION, { .i64 = INT64_MAX }, INT64_MIN, INT64_MAX, FLAGS }, \
{ "start_pts", "Timestamp of the first frame that should be " \
" passed", OFFSET(start_pts), AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, FLAGS }, \
{ "end_pts", "Timestamp of the first frame that should be " \
"dropped again", OFFSET(end_pts), AV_OPT_TYPE_INT64, { .i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, FLAGS }, \
{ "duration", "Maximum duration of the output", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT64_MAX, FLAGS }, \
{ "durationi", "Maximum duration of the output", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT64_MAX, FLAGS },
#define COMPAT_OPTS \
{ "start", "Timestamp in seconds of the first frame that " \
"should be passed", OFFSET(start_time_dbl),AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX }, -DBL_MAX, DBL_MAX, FLAGS }, \
{ "end", "Timestamp in seconds of the first frame that " \
"should be dropped again", OFFSET(end_time_dbl), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX }, -DBL_MAX, DBL_MAX, FLAGS }, \
{ "duration", "Maximum duration of the output in seconds", OFFSET(duration_dbl), AV_OPT_TYPE_DOUBLE, { .dbl = 0 }, 0, DBL_MAX, FLAGS },
#if CONFIG_TRIM_FILTER
static
int
trim_filter_frame
(
AVFilterLink
*
inlink
,
AVFrame
*
frame
)
...
...
@@ -197,7 +183,6 @@ static const AVOption trim_options[] = {
"to the output"
,
OFFSET
(
start_frame
),
AV_OPT_TYPE_INT64
,
{
.
i64
=
-
1
},
-
1
,
INT64_MAX
,
FLAGS
},
{
"end_frame"
,
"Number of the first frame that should be dropped "
"again"
,
OFFSET
(
end_frame
),
AV_OPT_TYPE_INT64
,
{
.
i64
=
INT64_MAX
},
0
,
INT64_MAX
,
FLAGS
},
COMPAT_OPTS
{
NULL
}
};
#undef FLAGS
...
...
@@ -352,7 +337,6 @@ static const AVOption atrim_options[] = {
"passed to the output"
,
OFFSET
(
start_sample
),
AV_OPT_TYPE_INT64
,
{
.
i64
=
-
1
},
-
1
,
INT64_MAX
,
FLAGS
},
{
"end_sample"
,
"Number of the first audio sample that should be "
"dropped again"
,
OFFSET
(
end_sample
),
AV_OPT_TYPE_INT64
,
{
.
i64
=
INT64_MAX
},
0
,
INT64_MAX
,
FLAGS
},
COMPAT_OPTS
{
NULL
}
};
#undef FLAGS
...
...
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