Commit 0500623d authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents ad8d063f 2dc5980d
...@@ -15,6 +15,9 @@ libavutil: 2012-10-22 ...@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first: 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 2013-12-xx - xxxxxxx - lavu 53.2.0 - frame.h
Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which
identifies AVMatrixEncoding data. identifies AVMatrixEncoding data.
......
...@@ -259,7 +259,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) ...@@ -259,7 +259,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
outbuf->pts = inbuf[0]->pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE : outbuf->pts = inbuf[0]->pts == AV_NOPTS_VALUE ? AV_NOPTS_VALUE :
inbuf[0]->pts + inbuf[0]->pts +
av_rescale_q(am->in[0].pos, 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); ctx->outputs[0]->time_base);
outbuf->nb_samples = nb_samples; outbuf->nb_samples = nb_samples;
......
...@@ -174,7 +174,7 @@ static int push_frame(AVFilterContext *ctx, unsigned in_no, AVFrame *buf) ...@@ -174,7 +174,7 @@ static int push_frame(AVFilterContext *ctx, unsigned in_no, AVFrame *buf)
if (inlink->sample_rate) if (inlink->sample_rate)
/* use number of audio samples */ /* use number of audio samples */
in->pts += av_rescale_q(buf->nb_samples, in->pts += av_rescale_q(buf->nb_samples,
(AVRational){ 1, inlink->sample_rate }, av_make_q(1, inlink->sample_rate),
outlink->time_base); outlink->time_base);
else if (in->nb_frames >= 2) else if (in->nb_frames >= 2)
/* use mean duration */ /* use mean duration */
......
...@@ -57,7 +57,7 @@ int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s) ...@@ -57,7 +57,7 @@ int ff_dualinput_init(AVFilterContext *ctx, FFDualInputContext *s)
in[1].after = EXT_INFINITY; in[1].after = EXT_INFINITY;
if (s->shortest) if (s->shortest)
in[1].after = EXT_STOP; in[0].after = in[1].after = EXT_STOP;
if (!s->repeatlast) { if (!s->repeatlast) {
in[0].after = EXT_STOP; in[0].after = EXT_STOP;
in[1].sync = 0; in[1].sync = 0;
......
...@@ -113,7 +113,7 @@ static int config_props(AVFilterLink *outlink) ...@@ -113,7 +113,7 @@ static int config_props(AVFilterLink *outlink)
outlink->h = tile->h * inlink->h + total_margin_h; outlink->h = tile->h * inlink->h + total_margin_h;
outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; outlink->sample_aspect_ratio = inlink->sample_aspect_ratio;
outlink->frame_rate = av_mul_q(inlink->frame_rate, 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_init(&tile->draw, inlink->format, 0);
ff_draw_color(&tile->draw, &tile->blank, tile->rgba_color); ff_draw_color(&tile->draw, &tile->blank, tile->rgba_color);
......
...@@ -45,6 +45,17 @@ typedef struct AVRational{ ...@@ -45,6 +45,17 @@ typedef struct AVRational{
int den; ///< denominator int den; ///< denominator
} 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. * Compare two rationals.
* @param a first rational * @param a first rational
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*/ */
#define LIBAVUTIL_VERSION_MAJOR 52 #define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 62 #define LIBAVUTIL_VERSION_MINOR 63
#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment