~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to libavfilter/vf_decimate.c

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    AVFrame **clean_src;    ///< frame queue for the clean source
44
44
    int got_frame[2];       ///< frame request flag for each input stream
45
45
    double ts_unit;         ///< timestamp units for the output frames
 
46
    int64_t start_pts;      ///< base for output timestamps
46
47
    uint32_t eof;           ///< bitmask for end of stream
47
48
    int hsub, vsub;         ///< chroma subsampling values
48
49
    int depth;
210
211
            av_frame_free(&dm->queue[i].frame);
211
212
        } else {
212
213
            AVFrame *frame = dm->queue[i].frame;
 
214
            if (frame->pts != AV_NOPTS_VALUE && dm->start_pts == AV_NOPTS_VALUE)
 
215
                dm->start_pts = frame->pts;
213
216
            if (dm->ppsrc) {
214
217
                av_frame_free(&frame);
215
218
                frame = dm->clean_src[i];
216
219
            }
217
 
            frame->pts = outlink->frame_count * dm->ts_unit;
 
220
            frame->pts = outlink->frame_count * dm->ts_unit +
 
221
                         (dm->start_pts == AV_NOPTS_VALUE ? 0 : dm->start_pts);
218
222
            ret = ff_filter_frame(outlink, frame);
219
223
            if (ret < 0)
220
224
                break;
259
263
 
260
264
static av_cold int decimate_init(AVFilterContext *ctx)
261
265
{
262
 
    const DecimateContext *dm = ctx->priv;
 
266
    DecimateContext *dm = ctx->priv;
263
267
    AVFilterPad pad = {
264
268
        .name         = av_strdup("main"),
265
269
        .type         = AVMEDIA_TYPE_VIDEO,
285
289
        return AVERROR(EINVAL);
286
290
    }
287
291
 
 
292
    dm->start_pts = AV_NOPTS_VALUE;
 
293
 
288
294
    return 0;
289
295
}
290
296
 
384
390
    { NULL }
385
391
};
386
392
 
387
 
AVFilter avfilter_vf_decimate = {
 
393
AVFilter ff_vf_decimate = {
388
394
    .name          = "decimate",
389
395
    .description   = NULL_IF_CONFIG_SMALL("Decimate frames (post field matching filter)."),
390
396
    .init          = decimate_init,