summaryrefslogtreecommitdiffstats
path: root/ffmpeg_filter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-01 14:35:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-01 17:24:43 +0200
commit4818388e6c219bf48fa93bf76ee6ab3dc3fb1e8f (patch)
tree22186855dca520f96dc3ec539ea387eabebab4a9 /ffmpeg_filter.c
parent76c1f9200fa3bf16a47042c0c2a1bd11e408b56c (diff)
parent8cd472d3f947a6233e7dc628f0dc71c74e62413a (diff)
downloadffmpeg-streaming-4818388e6c219bf48fa93bf76ee6ab3dc3fb1e8f.zip
ffmpeg-streaming-4818388e6c219bf48fa93bf76ee6ab3dc3fb1e8f.tar.gz
Merge commit '8cd472d3f947a6233e7dc628f0dc71c74e62413a'
* commit '8cd472d3f947a6233e7dc628f0dc71c74e62413a': avconv: make output -ss insert trim/atrim filters. Conflicts: Changelog ffmpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index b9e3e4e..58581c2 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -286,10 +286,12 @@ static int insert_trim(OutputStream *ost, AVFilterContext **last_filter, int *pa
char filter_name[128];
int ret = 0;
- if (of->recording_time == INT64_MAX)
+ if (of->recording_time == INT64_MAX && !of->start_time)
return 0;
- return 0;
+ // Use with duration and without output starttime is buggy with trim filters
+ if (!of->start_time)
+ return 0;
trim = avfilter_get_by_name(name);
if (!trim) {
@@ -304,8 +306,14 @@ static int insert_trim(OutputStream *ost, AVFilterContext **last_filter, int *pa
if (!ctx)
return AVERROR(ENOMEM);
- ret = av_opt_set_double(ctx, "duration", (double)of->recording_time / 1e6,
- AV_OPT_SEARCH_CHILDREN);
+ if (of->recording_time != INT64_MAX) {
+ ret = av_opt_set_double(ctx, "duration", (double)of->recording_time / 1e6,
+ AV_OPT_SEARCH_CHILDREN);
+ }
+ if (ret >= 0 && of->start_time) {
+ ret = av_opt_set_double(ctx, "start", (double)of->start_time / 1e6,
+ AV_OPT_SEARCH_CHILDREN);
+ }
if (ret < 0) {
av_log(ctx, AV_LOG_ERROR, "Error configuring the %s filter", name);
return ret;
OpenPOWER on IntegriCloud