input_ffmpeg: allocate sample buffer dynamically

also move call to get_buffer() after read_frames() in order to allow
reallocation of the frame buffer