Fix configure to check for outdated libavutil in resize filter support.
Do not print an explicit error message in ffms when requesting a frame beyond the number of frames in the source.
Mention in --*help that filtering options can be specified as name=value.
Fix the shadowing warning in the resize filter on posix systems.
error="swscale must be at least version 0.9.0"
if cc_check "libswscale/swscale.h" "$SWSCALE_CFLAGS $SWSCALE_LIBS" "sws_getContext(0,0,0,0,0,0,0,0,0,0);" ; then
if cpp_check "libswscale/swscale.h" "$SWSCALE_CFLAGS" "LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)" "$error"; then
- define HAVE_SWSCALE
- swscale="yes"
+ # we use colorspaces that were defined in libavutil r19775
+ if cc_check "libavutil/pixfmt.h" "$SWSCALE_CFLAGS" "enum PixelFormat pixfmt = PIX_FMT_YUV422P16LE;" ; then
+ define HAVE_SWSCALE
+ swscale="yes"
+ else
+ echo "Warning: libavutil is too old, update to ffmpeg r19775+"
+ fi
else
echo "Warning: ${error}"
fi
}
}
-static int round_dbl( double val, int precision, int truncate )
+static int round_dbl( double val, int precision, int b_truncate )
{
int ret = (int)(val / precision) * precision;
- if( !truncate && (val - ret) >= (precision/2) ) // use the remainder if we're not truncating it
+ if( !b_truncate && (val - ret) >= (precision/2) ) // use the remainder if we're not truncating it
ret += precision;
return ret;
}
FFMS_Track *track;
int reduce_pts;
int vfr_input;
+ int num_frames;
} ffms_hnd_t;
static int FFMS_CC update_progress( int64_t current, int64_t total, void *private )
FFMS_DestroyIndex( idx );
const FFMS_VideoProperties *videop = FFMS_GetVideoProperties( h->video_source );
- info->num_frames = videop->NumFrames;
+ info->num_frames = h->num_frames = videop->NumFrames;
info->sar_height = videop->SARDen;
info->sar_width = videop->SARNum;
info->fps_den = videop->FPSDenominator;
static int read_frame( cli_pic_t *pic, hnd_t handle, int i_frame )
{
ffms_hnd_t *h = handle;
+ if( i_frame >= h->num_frames )
+ return -1;
FFMS_ErrorInfo e;
e.BufferSize = 0;
const FFMS_Frame *frame = FFMS_GetFrame( h->video_source, i_frame, &e );
- FAIL_IF_ERROR( !frame, "could not read frame %d\n", i_frame )
+ FAIL_IF_ERROR( !frame, "could not read frame %d \n", i_frame )
memcpy( pic->img.stride, frame->Linesize, sizeof(pic->img.stride) );
memcpy( pic->img.plane, frame->Data, sizeof(pic->img.plane) );
H0( "\n" );
H0( "Filtering:\n" );
H0( "\n" );
+ H0( " Filter options may be specified in the name=value format\n" );
H0( "--vf, --video-filter <filter0>/<filter1>/... Apply video filtering to the input file\n" );
H0( " Available filters:\n" );
x264_register_vid_filters();