summaryrefslogtreecommitdiff
path: root/libavfilter/vf_select.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_select.c')
-rw-r--r--libavfilter/vf_select.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c
index bbfb63edf3..3ba2670a0f 100644
--- a/libavfilter/vf_select.c
+++ b/libavfilter/vf_select.c
@@ -45,18 +45,18 @@ static const char *var_names[] = {
"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)
@@ -317,19 +317,14 @@ static av_cold void uninit(AVFilterContext *ctx)
{
SelectContext *select = ctx->priv;
AVFilterBufferRef *picref;
- int i;
- if (select->expr)
- av_expr_free(select->expr);
+ av_expr_free(select->expr);
select->expr = NULL;
- if (select->pending_frames) {
- for (i = 0; i < av_fifo_size(select->pending_frames)/sizeof(picref); i++) {
- av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL);
- avfilter_unref_buffer(picref);
- }
- av_fifo_free(select->pending_frames);
- }
+ 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;
}