aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-19 17:48:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-19 17:48:07 +0100
commit0500623d5840cd148c85c65a70a42b3b91ffd8e1 (patch)
treec333c5bb464236e896ac9db51493d6851c8772ac
parentad8d063f230c05f8b5efbd05cc5a9f51a2549dcf (diff)
parent2dc5980d61493e05ccb04271a685fe804d87b155 (diff)
downloadffmpeg-0500623d5840cd148c85c65a70a42b3b91ffd8e1.tar.gz
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: lavfi/dualinput: fix shortest option. lavfi/vf_tile: use av_make_q. lavfi/avf_concat: use av_make_q. lavfi/af_amerge: use av_make_q. lavu/rational: add syntactic sugar. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--doc/APIchanges3
-rw-r--r--libavfilter/af_amerge.c2
-rw-r--r--libavfilter/avf_concat.c2
-rw-r--r--libavfilter/dualinput.c2
-rw-r--r--libavfilter/vf_tile.c2
-rw-r--r--libavutil/rational.h11
-rw-r--r--libavutil/version.h2
7 files changed, 19 insertions, 5 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index d43f459a4f..69a2c5a638 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
+2014-01-19 - xxxxxxx - lavu 52.63.100 - rational.h
+ Add av_make_q() function.
+
2013-12-xx - xxxxxxx - lavu 53.2.0 - frame.h
Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which
identifies AVMatrixEncoding data.
diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index 82b694bee5..591d672c48 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -259,7 +259,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
outbuf->pts = inbuf[0]->pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE :
inbuf[0]->pts +
av_rescale_q(am->in[0].pos,
- (AVRational){ 1, ctx->inputs[0]->sample_rate },
+ av_make_q(1, ctx->inputs[0]->sample_rate),
ctx->outputs[0]->time_base);
outbuf->nb_samples = nb_samples;
diff --git a/libavfilter/avf_concat.c b/libavfilter/avf_concat.c
index c211dc43d6..18f373ca0a 100644
--- a/libavfilter/avf_concat.c
+++ b/libavfilter/avf_concat.c
@@ -174,7 +174,7 @@ static int push_frame(AVFilterContext *ctx, unsigned in_no, AVFrame *buf)
if (inlink->sample_rate)
/* use number of audio samples */
in->pts += av_rescale_q(buf->nb_samples,
- (AVRational){ 1, inlink->sample_rate },
+ av_make_q(1, inlink->sample_rate),
outlink->time_base);
else if (in->nb_frames >= 2)
/* use mean duration */
diff --git a/libavfilter/dualinput.c b/libavfilter/dualinput.c
index 97e15cbe01..88f7a272f1 100644
--- a/libavfilter/dualinput.c
+++ b/libavfilter/dualinput.c
@@ -57,7 +57,7 @@ int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
in[1].after = EXT_INFINITY;
if (s->shortest)
- in[1].after = EXT_STOP;
+ in[0].after = in[1].after = EXT_STOP;
if (!s->repeatlast) {
in[0].after = EXT_STOP;
in[1].sync = 0;
diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c
index 786f4f6630..459ae462ef 100644
--- a/libavfilter/vf_tile.c
+++ b/libavfilter/vf_tile.c
@@ -113,7 +113,7 @@ static int config_props(AVFilterLink *outlink)
outlink->h = tile->h * inlink->h + total_margin_h;
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
outlink->frame_rate = av_mul_q(inlink->frame_rate,
- (AVRational){ 1, tile->nb_frames });
+ av_make_q(1, tile->nb_frames));
ff_draw_init(&tile->draw, inlink->format, 0);
ff_draw_color(&tile->draw, &tile->blank, tile->rgba_color);
diff --git a/libavutil/rational.h b/libavutil/rational.h
index b9800ee360..7439701db2 100644
--- a/libavutil/rational.h
+++ b/libavutil/rational.h
@@ -46,6 +46,17 @@ typedef struct AVRational{
} AVRational;
/**
+ * Create a rational.
+ * Useful for compilers that do not support compound literals.
+ * @note The return value is not reduced.
+ */
+static inline AVRational av_make_q(int num, int den)
+{
+ AVRational r = { num, den };
+ return r;
+}
+
+/**
* Compare two rationals.
* @param a first rational
* @param b second rational
diff --git a/libavutil/version.h b/libavutil/version.h
index 9e4f20281a..1682f89a43 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 62
+#define LIBAVUTIL_VERSION_MINOR 63
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \