"prev_selected_t", ///< previously selected time
"pict_type", ///< the type of picture in the movie
- "PICT_TYPE_I",
- "PICT_TYPE_P",
- "PICT_TYPE_B",
- "PICT_TYPE_S",
- "PICT_TYPE_SI",
- "PICT_TYPE_SP",
- "PICT_TYPE_BI",
+ "I",
+ "P",
+ "B",
+ "S",
+ "SI",
+ "SP",
+ "BI",
"interlace_type", ///< the frame interlace type
- "INTERLACE_TYPE_P",
- "INTERLACE_TYPE_T",
- "INTERLACE_TYPE_B",
+ "PROGRESSIVE",
+ "TOPFIRST",
+ "BOTTOMFIRST",
"n", ///< frame number (starting from zero)
"selected_n", ///< selected frame number (starting from zero)
if (isnan(select->var_values[VAR_START_PTS]))
select->var_values[VAR_START_PTS] = TS2D(picref->pts);
+ if (isnan(select->var_values[VAR_START_T]))
+ select->var_values[VAR_START_T] = TS2D(picref->pts) * av_q2d(inlink->time_base);
select->var_values[VAR_PTS] = TS2D(picref->pts);
- select->var_values[VAR_T ] = picref->pts * av_q2d(inlink->time_base);
+ select->var_values[VAR_T ] = TS2D(picref->pts) * av_q2d(inlink->time_base);
select->var_values[VAR_POS] = picref->pos == -1 ? NAN : picref->pos;
select->var_values[VAR_PREV_PTS] = TS2D(picref ->pts);
{
SelectContext *select = ctx->priv;
AVFilterBufferRef *picref;
- int i;
av_expr_free(select->expr);
select->expr = NULL;
- for (i = 0; i < av_fifo_size(select->pending_frames)/sizeof(picref); i++) {
- av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL);
+ while (select->pending_frames &&
+ av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL) == sizeof(picref))
avfilter_unref_buffer(picref);
- }
av_fifo_free(select->pending_frames);
+ select->pending_frames = NULL;
}
AVFilter avfilter_vf_select = {